View Single Post
Old 04-10-2008, 11:21 AM   #9
Code Monkey
sws's Avatar
Join Date: Sep 2007
Location: Madison, WI
Posts: 851

Originally Posted by Deric View Post
There should be a way to define this (return code) as some sort of 'program variable' (sorry - my terminology is currently lacking) such that, should another program run the program, it can determine it's return code (if that code !=0).
To be clearer, do this:
int iRet = _spawnl(_P_WAIT, "c:\somepath\someprog.exe");
Your program runs, and when it exits, the value returned from main() or the value passed to exit() will be in the variable iRet.

Last edited by sws; 04-10-2008 at 11:24 AM.
sws is offline   Reply With Quote