PRB: Global MFC DAO Objects Cause Assertions (145992)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
This article was previously published under Q145992 SYMPTOMS
An assertion can occur on line 729, 732, or 1314 of Daocore.cpp when you
define an MFC DAO object that has its destructor called after the call to
CWinApp::ExitInstance.
This will happen when an MFC DAO object is defined globally or as a member
of a global object (like an MFC application's CWinApp-derived object).
CAUSE
CWinApp::ExitInstance() closes all open DAO workspaces by calling
AfxDaoTerm() and removes them from the global workspace map. In the
destructors for MFC DAO objects such as CDaoDatabase and CDaoRecordset,
MFC tries to remove the workspace objects again.
RESOLUTION
Here are two workarounds: STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 10/24/2003 |
---|
Keywords: | kbDatabase kbprb KB145992 kbAudDeveloper |
---|
|