|
-
April 26th, 2010, 01:41 PM
#1
[C++] get results of console
I have a Win32 app and with that app i'm going to open another .exe file. That other .exe file is a console app and it will write some data to that console. Now i was wondering if there's anyway my win32 app can read the output of that console..??
-
April 26th, 2010, 01:54 PM
#2
Re: [C++] get results of console
The calling app should be able to receive the return value of the other program. But this of course is only a integer value. In Unix, one console application can take another application as a parameter and pipe it's output into that program.
-
April 26th, 2010, 02:10 PM
#3
Re: [C++] get results of console
I'd redirect the output of that console program to a file ( via myexe.exe > "out.txt" ).
Your Gui App could then read that file.
Kurt
-
April 26th, 2010, 02:11 PM
#4
Re: [C++] get results of console
 Originally Posted by Chris_F
The calling app should be able to receive the return value of the other program. But this of course is only a integer value. In Unix, one console application can take another application as a parameter and pipe it's output into that program.
So with other words, it's not really possible in Windows to get the entire output pf a console window?? Eventhough my app is the one opening that console app...?
-
April 26th, 2010, 02:48 PM
#5
Re: [C++] get results of console
Well, you can either output the console to a temporary file, or you can use pipes.
-
April 26th, 2010, 04:13 PM
#6
Re: [C++] get results of console
Here's an example of redirecting stdin, stdout, and stderr using CreateProcess and pipes.
Viggy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|