Depends on whether the child process is a console application or an MS-Windows program. Console: just return the int value from main(). MS-Windows: PostQuitMessage ()
On the parent process side: After calling CreateProcess(), call WaitForSingleObject() then when that returns call GetExitCodeProcess () to get the exit status of the spawned program. Note: this does not work well with Mobile 5 wireless MFC programs because the MFC code will return 0 regardless of the parameter in PostQuitMessage().
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>>Is there a way to pass a pointer from the parent to the child and have the child populate it?
No because the two probrams are in different address spaces. You could copy the strings to the clipboard or put them into a mem file. Or you could open a pipe to the two programs and parent could read the strings directly through the pipe.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343