Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 570
  • Last Modified:

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..
0
ewong_111
Asked:
ewong_111
  • 2
1 Solution
 
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
 
mxjijoCommented:

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

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now