Thread: getexitcodeprocess exit code

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    351

    getexitcodeprocess exit code

    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

  2. #2
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    Sorry - was checking the dwexitcode wrongly - should be

    Code:
    if(dwExitCode > 0)
    The process of posting helps me to solve my problems myself!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Odd memory leaks
    By VirtualAce in forum C++ Programming
    Replies: 11
    Last Post: 05-25-2006, 12:56 AM
  2. Replies: 1
    Last Post: 03-21-2006, 07:52 AM
  3. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM
  4. exit program
    By spentdome in forum C Programming
    Replies: 4
    Last Post: 04-22-2002, 02:08 PM
  5. how do you change the ctrl+C exit code?
    By Golden Bunny in forum Windows Programming
    Replies: 0
    Last Post: 04-09-2002, 02:18 PM