Reputation: 872
I execute an .exe within my code. Like:
if( !CreateProcess( NULL, // No module name (use command line)
"sub.exe 2", // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi ) // Pointer to PROCESS_INFORMATION structure
)
The sub.exe multiplies simply the given value with 3. So that I should get a 6
How do I get the responded string to work with in my further code?
Upvotes: 0
Views: 293
Reputation: 7479
See these Microsoft samples on how to capture the standard output and error via pipes:
Upvotes: 2