Capturing standard output of the process run from my app

G

Guest

Hello.

I’m trying to capture standard output of the other process which is
launched from my win app. I tried to do it with freopen function which
captured content of the printf functions, but not the output of the other
processes (even if it used printf function and launched with system function).

How can I perform my task?
How should I run other processes?

Thanks for suggestions.
 
W

William DePalo [MVP VC++]

Ivan said:
I'm trying to capture standard output of the other process which is
launched from my win app. I tried to do it with freopen function which
captured content of the printf functions, but not the output of the other
processes (even if it used printf function and launched with system
function).

How can I perform my task?
How should I run other processes?

The usual advice would have your parent process creating "pipes" which are
used as the child's standard input and/or output devices. The child
unknowingly writes its output to a pipe. The parent reads from the pipe and
displays, parses, analyzes it as necessary. Details are here:

http://support.microsoft.com/?id=190351

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top