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

Last reviewed: July 18, 1997
Article ID: 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 MfcDocView kbbuglist kbprg
Technology : kbMfc
Version : 1.52
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.