Click here to Skip to main content
15,920,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: attach to WM_MOVE event of a window Pin
ThatsAlok30-May-06 1:57
ThatsAlok30-May-06 1:57 
QuestionOpinions Wanted on Hypothetical DLL Loading Pin
Richard Andrew x6429-May-06 21:31
professionalRichard Andrew x6429-May-06 21:31 
AnswerRe: Opinions Wanted on Hypothetical DLL Loading Pin
toxcct29-May-06 21:38
toxcct29-May-06 21:38 
AnswerRe: Opinions Wanted on Hypothetical DLL Loading Pin
Stephen Hewitt29-May-06 23:20
Stephen Hewitt29-May-06 23:20 
GeneralRe: Opinions Wanted on Hypothetical DLL Loading Pin
Richard Andrew x6429-May-06 23:25
professionalRichard Andrew x6429-May-06 23:25 
AnswerRe: Opinions Wanted on Hypothetical DLL Loading Pin
Nibu babu thomas30-May-06 1:33
Nibu babu thomas30-May-06 1:33 
Question[Message Deleted] Pin
_kal_29-May-06 21:25
_kal_29-May-06 21:25 
AnswerRe: Moving Caret using SetCaretPos Pin
G Haranadh29-May-06 23:08
G Haranadh29-May-06 23:08 
GeneralRe: Moving Caret using SetCaretPos Pin
G Haranadh30-May-06 0:41
G Haranadh30-May-06 0:41 
AnswerRe: Moving Caret using SetCaretPos Pin
ThatsAlok30-May-06 1:50
ThatsAlok30-May-06 1:50 
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 

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.