Microsoft KB Archive/132105

From BetaArchive Wiki

BUG: OnEnable Not Exported From MFC250(D).DLL

Q132105

1.52 WINDOWS kbprg kbbuglist --------------------------------------------------------------------- The information in this article applies to: - The Microsoft Foundation Classes (MFC) included with: Microsoft Visual C++ for Windows, version 1.52 --------------------------------------------------------------------- SYMPTOMS ======== If you link to the DLL version of MFC and the CFrameWnd::OnEnable function is referenced in the project, this error occurs: error L2029: 'protected: void __far __pascal CFrameWnd::OnEnable(int)__far' : unresolved external CAUSE ===== CFrameWnd::OnEnable is not exported in MFC250D.DEF. This error usually occurs when the function has been overridden in a derived class such as CMainFrame and a call to the base class version is included by ClassWizard. RESOLUTION ========== To work around this problem, copy the code from CFrameWnd::OnEnable to the derived class and remove the call to the base class. The code can be found in MSVC\MFC\SRC\WINFRM.CPP starting at line 243. For Example: void CMainFrame::OnEnable(BOOL bEnable) { if (bEnable && GetProp(m_hWnd, "StayDisabled")) { // Work around for MAPI support. This makes sure the main window // remains disabled even when the mail system is booting. EnableWindow(FALSE); ::SetFocus(NULL); return; } Default(); // TODO: Add your message handler code here } STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. Additional reference words: 1.52 2.52 KBCategory: kbprg kbbuglist KBSubcategory: MfcDocView

Keywords : kb16bitonly kbDocView kbMFC kbVC
Issue type :
Technology : kbAudDeveloper kbMFC


Last Reviewed: July 23, 1997
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.