How can I make so my program executes another exe and waits until that exe has exited, checks the return code, and then continues?
I guess you can do that with WaitForSingleObject... I'm not very sure, I used these tricks for a while now...
A confirmation/infirmation would be nice...
*EDIT* : I checked on google, and I was right : WaitForSingleObject is a (the ?) way to go...
For more details and example code :
http://www.codeguru.com/system/runProcess.html
A confirmation/infirmation would be nice...
*EDIT* : I checked on google, and I was right : WaitForSingleObject is a (the ?) way to go...
For more details and example code :
http://www.codeguru.com/system/runProcess.html
You'd better check the boardhttp://www.asmcommunity.net/board/index.php?topic=4576&highlight=WaitForSingleObject
Svin,
i have just seen your reply to my answer in that thread that you posted the link for, and yes you are totally correct, that is another proper way to do it :)
i have just seen your reply to my answer in that thread that you posted the link for, and yes you are totally correct, that is another proper way to do it :)
You can use CreateProcess for launching the exe and GetExitCodeProcess for testing if the debugee exits
Imo WaitForSingleObject is the nicest method to wait for process
termination - you can then call GetExitCodeProcess to see if something
"abnormal" happened. Calilng GetExitCodeProcess in a loop to wait
for process termination? No no no.
termination - you can then call GetExitCodeProcess to see if something
"abnormal" happened. Calilng GetExitCodeProcess in a loop to wait
for process termination? No no no.