Article ID: 231592 - Last Review: May 3, 2005 - Revision: 4.1 BUG: ClassWizard adds the AfxGetStaticModuleState() in an MFC executable program in Visual C++ 6.0This article was previously published under Q231592 SYMPTOMS
When using ClassWizard to add Methods and Properties to an ATL interface in a MFC Application, ClassWizard will add the following line to the top of each function: AfxGetAppModuleState() should be used in MFC EXEs. RESOLUTION
Change the AFX_MANAGE_STATE line to read: STATUS
This bug was corrected in Microsoft Visual Studio .NET 2002.
MORE INFORMATION
MFC classes which use global and thread based MFC data need to use a specific MFC module state. As a result, entry points need to switch module states using the AFX_MANAGE_STATE macro to the module state associated with the EXE or DLL. Entry points that would be affected include callback functions, custom windows procedures, and COM interfaces that are called from inproc servers. REFERENCES
For more information on MFC Module States, see the MFC technote TN058: MFC Module State Implementation. | Article Translations
|
Back to the top
