How to Debug WEP(), _WEP(), and ExitInstance() in 16-bit DLLsLast reviewed: July 18, 1997Article ID: Q148734 |
1.00 1.50 1.51 1.52
WINDOWS
kbtool kbhowto
The information in this article applies to:
SUMMARYThe Visual C++ Workbench debugger does not support debugging the Windows Exit Procedure (WEP) or functions called from WEP for implicitly loaded DLLs. CodeView for Windows does support debugging WEPs but only if the calling application is not the application being debugged by CodeView for Windows. Breakpoints set through the debugger or DebugBreak() will not be hit. MFC TRACE() statements and OutputDebugString() messages will not show up in the debug window. However, DBWIN can be used to see these debug messages. DBWIN can be started from the Program Manager by opening the DebugWin icon or by running Dbwin.exe from the Msvc\Bin directory. NOTE: CodeView requires Windows 3.1 and is not compatible with Windows NT or Windows 95.
MORE INFORMATIONBoth the Workbench debugger and CodeView for Windows stop debugging when the main application being debugged exits. This occurs before the implicitly linked DLLs are actually unloaded from memory and their Windows Exit Procedures (WEPs) are called. By default, the Windows Exit Procedure (WEP) is implemented by the C Run-Time (CRT). The CRT version of WEP calls _WEP(), the user-defined Windows Exit Procedure. In MFC _USRDLLs, _WEP() in turn calls ExitInstance(). Also, all destructors for static C++ objects are called from the default CRT WEP. This debugger limitation applies to all of these functions.
Step-by-Step Example for Debugging ProcedureBecause CodeView for Windows supports multi-process debugging, it is possible to work around this problem by following these steps:
Implicitly loaded DLLs are DLLs that are loaded automatically by Windows by linking with an import library or by using the IMPORTS module definition file statement. In DLLs that are explicitly linked, loaded, and freed through LoadLibrary() and FreeLibrary(), there are no problems debugging the WEP both the Workbench debugger and CodeView for Windows.
REFERENCESFor more information on why breakpoints fail, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q121556 TITLE : PRB: Breakpoints Won't Work - 11 Reasons WhyThis article covers, among other things, why breakpoints may not work in MFC source code files. See the "Breakpoints Fail When Multiple Source Files Have the Same Name" section for more information.
|
Additional reference words: 1.00 1.50 kbinf CVW
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |