Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Runtime error: MFC71.dll AfxTermExtensionModule

Posted on 2004-10-01
Medium Priority
Last Modified: 2013-12-03

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)

      // search for CDynLinkLibrary matching state.hModule and delete it
      ASSERT(state.hModule != NULL);
      AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
      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;

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

      // remove any entries from the CWnd message map cache

Many thanks..
Question by:ewong_111
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Author Comment

ID: 12202803

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.


Accepted Solution

mxjijo earned 1500 total points
ID: 12205123

Web Quote :

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

          // TODO: perform other cleanup tasks here

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question