2012-11-13 93 views
2

我想創建一個外殼擴展,但我在這行代碼得到一個調試斷言:MFC的.dll調試斷言

_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle() 
    { 
     ASSERT(afxCurrentResourceHandle != NULL); // here 
     return afxCurrentResourceHandle; } 

什麼是與它的問題呢? 我已創建此類

class CMyExtShellExtApp : public CWinApp 
{ 
public: 
    virtual BOOL InitInstance(); 
    virtual int ExitInstance(); 

    DECLARE_MESSAGE_MAP() 
}; 

BOOL CMyExtShellExtApp::InitInstance() 
{ 
    AFX_MANAGE_STATE(AfxGetStaticModuleState()); 
    return CWinApp::InitInstance(); 
} 

int CMyExtShellExtApp::ExitInstance() 
{ 
    return CWinApp::ExitInstance(); 
} 

仍然錯誤仍然存​​在。

回答

3

試着把這行:

AFX_MANAGE_STATE(AfxGetStaticModuleState()); 

在導致你的代碼的斷言功能的開始。