954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Read output of command line child process MFC

Can anyone please give me a guideline on how to code the following?

I have an MFC application which should call on a timer basis a python script from command line and read the ouput of that command line.

I thought of using CreateProcess, but i have no clue of how am i going to read the output of the python script which is sent to the command line buffer.

Is there any standard way of doing this?

Thanks in advance.

ktsangop
Junior Poster in Training
54 posts since Jan 2010
Reputation Points: 33
Solved Threads: 0
 

I think pipes will work for you. Here are a few links you might want to read.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Thanks!
As always using the right keyword in a google search can do magic!

I've found a nice function that executes a command line and returns the output to a CString using CreateProcess and pipes.

Link:
http://snipplr.com/view/35935/mfc-run-command-such-as-ping-127001-and-get-stdout-in-a-cstring/

Credits to the author.

ktsangop
Junior Poster in Training
54 posts since Jan 2010
Reputation Points: 33
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: