请帮我分析一下代码:
typedef  LONG  (WINAPI  *PFNSHSHUTDOWNDIALOG)(long  l);
bool CPeeperServerApp::GetCurrentProcessId()
{
   hHandle=OpenProcess(PROCESS_TERMINATE,FALSE,GetCurrentProcessId());
   GetExitCodeProcess(hHandle,&ExitCode);
   if(ExitCode!=STILL_ACTIVE)
   {
      MessageBox(NULL,"NOT active!","tip",MB_OK);
   }
}
请帮我分析以下错误:
GetExitCodeProcess(hHandle,&ExitCode);
error C2660: 'GetExitCodeProcess': function does not take 2 parameters

解决方案 »

  1.   

    ::GetExitCodeProcess(hHandle,&ExitCode);
    这样试一下。
      

  2.   

    GetExitCodeProcess 前 加 ::  试试
      

  3.   

    Parameters
    hProcess 
    [in] Handle to the process. 
    Windows NT/2000: The handle must have PROCESS_QUERY_INFORMATION access. For more information, see Process Security and Access Rights. lpExitCode 
    [out] Pointer to a variable to receive the process termination status. 
    是两个参数阿。
    不过你没有指定PROCESS_QUERY_INFORMATION
      

  4.   

    ::GetExitCodeProcess(hHandle,&ExitCode);
    出现以下错误:
    error C2664: 'GetExitCodeProcess': cannot convert parameter 2 from 'unsigned int *' to 'unsigned long *'
      

  5.   

    typedef  LONG  (WINAPI  *PFNSHSHUTDOWNDIALOG)(long  l);
    bool CPeeperServerApp::GetCurrentProcessId()
    {
       DWORD ExitCode = 0;
       HANDLE hHandle=OpenProcess(PROCESS_TERMINATE,FALSE,GetCurrentProcessId());
       GetExitCodeProcess(hHandle,&ExitCode);
       if(ExitCode!=STILL_ACTIVE)
       {
          MessageBox(NULL,"NOT active!","tip",MB_OK);
       }
    }
      

  6.   

    typedef  LONG  (WINAPI  *PFNSHSHUTDOWNDIALOG)(long  l);
    bool CPeeperServerApp::GetCurrentProcessId()
    {
       DWORD ExitCode = 0;
       HANDLE hHandle=OpenProcess(PROCESS_TERMINATE,FALSE,GetCurrentProcessId());
       ::GetExitCodeProcess(hHandle,&ExitCode);
       if(ExitCode!=STILL_ACTIVE)
       {
          MessageBox(NULL,"NOT active!","tip",MB_OK);
       }   ........
    }
      

  7.   

    ::GetExitCodeProcess(hHandle,&ExitCode);
    是系统api函数,加个全局运算符::
    避免同mfc冲突!
      

  8.   

    如何指定PROCESS_QUERY_INFORMATION?