I am trying to create a shell extension but I’m getting a debug assertion at this line of code:
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{
ASSERT(afxCurrentResourceHandle != NULL); // here
return afxCurrentResourceHandle; }
What’s the problem with it?
I have created this class
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();
}
Still the error remains.
Try to put this line:
at the very beginning of the function causing the assertion in your code.