VOID ExitProcess()(UINT uExitCode) 这个参数一般是什么  怎么得到的

解决方案 »

  1.   

    引自MSDN:
    VOID ExitProcess(
      UINT uExitCode   // exit code for all threads
    );
     
    Parameters
    uExitCode 
    Specifies the exit code for the process, and for all threads that are terminated as a result of this call. Use the GetExitCodeProcess function to retrieve the process's exit value. Use the GetExitCodeThread function to retrieve a thread's exit value. 
    这个uExitCode一般是自己人工终止程序的时候给出的一个信号量,表明什么原因退出进程,这个标志可以人为的约定好的。
      

  2.   

    0 1可能被系统预定义了含义的,这个函数在使用子进程的时候,可以由父进程获得其退出参数,一般是子进程发生错误,自己使用该函数退出,比如退出参数为33(约定退出原因是数据库访问错误),那么父进程使用GetExitCodeProcess获得这个退出码33,就知道是因为数据库访问错误退出的。