The information in this article applies to:
SYMPTOMSCWinApp::ExitInstance() never gets called for the CWinApp object in a _USRDLL built with the Microsoft Foundation Classes (MFC) for Windows NT, version 2.1. CAUSEThe DLLMain function for a _USRDLL is provided by MFC. This function can be found in the MFC source directory (MSVC\MFC\SRC by default) in the file WINMAIN.CPP. Unlike a Windows 3.1 DLL, which has both an initialization and a termination function, a Windows NT DLL calls one function, DLLMain(), for both purposes. The DLLMain() function supplied by MFC has no call to ExitInstance() when DLL_PROCESS_DETACH is received. RESOLUTIONProvide your own DLLMain() function in your _USRDLL project by copying the current DLLMain() implementation into a new .CPP module and add the new .CPP file to your project. Modify the new DLLMain() to add the calls to ExitInstance() where necessary. The new module would look like this:
STATUSMicrosoft has confirmed this to be a bug in the products listed at the beginning of this article. This problem was corrected in MFC version 3.0, included with Microsoft Visual C++ 32-bit Edition, version 2.0. Additional query words: 1.00 2.00 2.10
Keywords : kbDLL kbMFC kbVC |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |