Click here to Skip to main content
15,892,809 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem with spliltter window Pin
sahaja_p29-May-06 21:15
sahaja_p29-May-06 21:15 
AnswerRe: Problem with spliltter window Pin
Ganesh_T29-May-06 22:25
Ganesh_T29-May-06 22:25 
AnswerRe: Problem with spliltter window Pin
NiceNaidu30-May-06 0:34
NiceNaidu30-May-06 0:34 
QuestionCapturing cprintf Pin
eku29-May-06 20:58
eku29-May-06 20:58 
AnswerRe: Capturing cprintf [modified] Pin
toxcct29-May-06 21:28
toxcct29-May-06 21:28 
GeneralRe: Capturing cprintf Pin
kakan29-May-06 23:14
professionalkakan29-May-06 23:14 
GeneralRe: Capturing cprintf Pin
toxcct29-May-06 23:16
toxcct29-May-06 23:16 
GeneralRe: Capturing cprintf [modified] Pin
eku30-May-06 8:14
eku30-May-06 8:14 
Thanks you guys, but it still doesn't solve any of my problems.
I'm NOT trying to redirect output to a file, I'd like to capture the output from my Win32 program that executes the command line tools (without showing any command line window).

The redirections doesn't redirect the cprintf outputs anyway.
Consider the following test application:
<br />
#include <conio.h><br />
#include <stdio.h><br />
<br />
void<br />
main(void)<br />
{<br />
	printf("This line is printed using printf(...)\n");<br />
	cprintf("This line is printed using cprintf(...)\n");<br />
	fprintf(stdout, "This line is printed using fprintf(stdout, ...)\n");<br />
	fprintf(stderr, "This line is printed using fprintf(stderr, ...)\n");<br />
}<br />

Running this with some redirections give:
<br />
T:\>test.exe<br />
This line is printed using printf(...)<br />
This line is printed using cprintf(...)<br />
This line is printed using fprintf(stdout, ...)<br />
This line is printed using fprintf(stderr, ...)<br />
<br />
T:\>test.exe > temp.log<br />
This line is printed using cprintf(...)<br />
This line is printed using fprintf(stderr, ...)<br />
<br />
T:\>test.exe 2> temp.log<br />
This line is printed using printf(...)<br />
This line is printed using cprintf(...)<br />
This line is printed using fprintf(stdout, ...)<br />

As you see it's impossible to capture ALL output.
(Btw is there a way to capture both stdout and stderr to the same file and preserve the order?)

From my Win32 program I can capture all cases except the cprintf one.

So I'll ask again if anyone have some hints on how to do it since I'm quite sure it's doable, cmd replacements like 4NT seems to handle that.

eq

-- modified at 14:17 Tuesday 30th May, 2006
QuestionList box Issue Pin
itkid29-May-06 20:22
itkid29-May-06 20:22 
AnswerRe: List box Issue Pin
_AnsHUMAN_ 29-May-06 20:30
_AnsHUMAN_ 29-May-06 20:30 
GeneralRe: List box Issue Pin
itkid29-May-06 21:06
itkid29-May-06 21:06 
GeneralRe: List box Issue Pin
_AnsHUMAN_ 29-May-06 22:02
_AnsHUMAN_ 29-May-06 22:02 
AnswerRe: List box Issue Pin
Hamid_RT29-May-06 20:30
Hamid_RT29-May-06 20:30 
AnswerRe: List box Issue Pin
Sarath C29-May-06 20:43
Sarath C29-May-06 20:43 
AnswerRe: List box Issue Pin
Member 303984329-May-06 22:55
Member 303984329-May-06 22:55 
QuestionGot problem with reading files Pin
Immunity1829-May-06 18:42
Immunity1829-May-06 18:42 
AnswerRe: Got problem with reading files Pin
bob1697229-May-06 19:27
bob1697229-May-06 19:27 
GeneralRe: Got problem with reading files Pin
Immunity1829-May-06 19:30
Immunity1829-May-06 19:30 
GeneralRe: Got problem with reading files [modified] Pin
bob1697229-May-06 19:41
bob1697229-May-06 19:41 
GeneralRe: Got problem with reading files [modified] Pin
Immunity1829-May-06 19:49
Immunity1829-May-06 19:49 
GeneralRe: Got problem with reading files Pin
Immunity1829-May-06 19:40
Immunity1829-May-06 19:40 
QuestionCListCtrl with tool tip to have multiple lines Pin
Kyle P29-May-06 16:05
Kyle P29-May-06 16:05 
AnswerRe: CListCtrl with tool tip to have multiple lines [modified] Pin
bob1697229-May-06 17:52
bob1697229-May-06 17:52 
GeneralRe: CListCtrl with tool tip to have multiple lines [modified] Pin
Sarath C29-May-06 18:30
Sarath C29-May-06 18:30 
GeneralRe: CListCtrl with tool tip to have multiple lines [modified] Pin
bob1697229-May-06 19:01
bob1697229-May-06 19:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.