Solved

Runtime error: MFC71.dll AfxTermExtensionModule

Posted on 2004-10-01
3
534 Views
Last Modified: 2013-12-03
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
Comment
Question by:ewong_111
[X]
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
3 Comments
 
LVL 2

Author Comment

by:ewong_111
ID: 12202803
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
 
LVL 8

Expert Comment

by:mxjijo
ID: 12205117
0
 
LVL 8

Accepted Solution

by:
mxjijo earned 500 total points
ID: 12205123

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…

697 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