Hi All,
Maybe I'm getting confused - but - the docs say this:
http://msdn.microsoft.com/library/de...odeprocess.asp
<quote>
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
</quote>
So I'm doing this:
Code:
if(GetExitCodeProcess(piProcessInfo.hProcess, &dwExitCode) == 0)
{
//timeout or error
perror("Error getting exit code");
res = GetLastError();
perror("Error getting exit code");
}
if(dwExitCode == 0)
{
perror("Error getting exit code");
res = GetLastError();
perror("Error getting exit code");
}
perror and getlasterror all return 0 (no matter which one comes first) <scratches head> - are the docs wrong?
Cheers, rotis23