Runtime error: MFC71.dll AfxTermExtensionModule

Hi,

Anyone knows what this runtime error is about?

>      MFC71.dll!AfxTermExtensionModule(AFX_EXTENSION_MODULE & state={...}, int bAll=1)  Line 185 + 0x4      C++

void AFXAPI AfxTermExtensionModule(AFX_EXTENSION_MODULE& state, BOOL bAll)
{
      // make sure initialized
      if (!state.bInitialized)
            return;

      // search for CDynLinkLibrary matching state.hModule and delete it
      ASSERT(state.hModule != NULL);
      AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
      AfxLockGlobals(CRIT_DYNLINKLIST);
      for (CDynLinkLibrary* pDLL = pModuleState->m_libraryList; pDLL != NULL; )
      {
            CDynLinkLibrary* pNextDLL = pDLL->m_pNextDLL;
            if (bAll || pDLL->m_hModule == state.hModule)
                  delete pDLL;    // will unwire itself     <------------------------------ Line 185
            pDLL = pNextDLL;
      }
      AfxUnlockGlobals(CRIT_DYNLINKLIST);

      // delete any local storage attached to this module
      AfxTermLocalData(state.hModule, TRUE);

      // remove any entries from the CWnd message map cache
      AfxResetMsgCache();
}

Many thanks..
LVL 2
ewong_111Asked:
Who is Participating?
 
mxjijoConnect With a Mentor Commented:

Web Quote :

<quote>
RESOLUTION
Add the following line to the DLL_PROCESS_DETACH section of an AppWizard- generated Extension DLL's DllMain():    else if (dwReason == DLL_PROCESS_DETACH)
   {
      // Add the following line
      AfxTermExtensionModule(extensionDLL);

          // TODO: perform other cleanup tasks here
   }
                        
<quote>
0
 
ewong_111Author Commented:
Sorry..

Forgot to post the output..

First-chance exception at 0x7c18079f (MFC71.dll) in DLLClient.exe: 0xC0000005: Access violation reading location 0x7c003337.
Unhandled exception at 0x7c18079f (MFC71.dll) in DLLClient.exe: 0xC0000005: Access violation reading location 0x7c003337.

Thanks..
0
All Courses

From novice to tech pro — start learning today.