title: MFC .dll debug assertion
body: <p>I am trying to create a shell extension but I'm getting a debug assertion at this line of code:</p>
  
  <pre><code>_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
      { 
          ASSERT(afxCurrentResourceHandle != NULL);  // here
          return afxCurrentResourceHandle; }
  </code></pre>
  
  <p>What's the problem with it?
  I have created this class</p>
  
  <pre><code>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();
  }
  </code></pre>
  
  <p>Still the error remains.</p>