是最上层的窗口枸柄??

解决方案 »

  1.   

    是你定义的CWinApp的派生类的唯一实例(theApp),不是窗口。
      

  2.   

    AfxGetApp  
    CWinApp* AfxGetApp( ); Return ValueA pointer to the single CWinApp object for the application.ResThe pointer returned by this function can be used to access application information such as the main message-dispatch code or the topmost window.Example// Print the application's executable filename.
    TRACE("Executable filename = %s\n", AfxGetApp()->m_pszExeName);                       --------From MSDN
      

  3.   

    _AFXWIN_INLINE CWinApp* AFXAPI AfxGetApp()
    { return afxCurrentWinApp; }#define afxCurrentWinApp    AfxGetModuleState()->m_pCurrentWinApp看到了没有~m_pCurrentWinApp~
    就是你声明的那个CWinApp CMyWinApp;
      

  4.   

    指向CMyWinApp的指针啊!看看楼上给出的源代码,不就清楚了?
      

  5.   

    AfxGetApp()是程序示例的对象指针AfxGetApp()->m_pMainWnd->GetSafeHwnd()返回句柄