BUG: MFC Library Build Fails with NOSTRICT Defined

Last reviewed: July 22, 1997
Article ID: Q117795
1.50 WINDOWS kbprg kbbuglist

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC) included with:

        - Microsoft Visual C++ for Windows, version 1.5
    

SYMPTOMS

Specifying OPT="/DNOSTRICT" when building the MFC Library version 2.5 variants generates the following message:

   oledobj2.cpp(706) : error C2664: 'CallWindowProc' : cannot convert
     parameter 1 from 'long (__far __pascal *)(unsigned int ,unsigned
     int ,unsigned int ,long )' to 'int (__far __pascal *)(void )'

CAUSE

The problem is caused by the declaration of afxPrevClipboardWndProc (OLEDOBJ2.CPP, line 692). The variable is declared like this:

   extern WNDPROC NEAR _afxPrevClipboardWndProc;

That variable is passed as the first argument to the CallWindowProc in line 706. The CallWindowProc is declared in the WINDOWS.H file like this:

   #ifdef STRICT
   LRESULT WINAPI CallWindowProc(WNDPROC, HWND, UINT, WPARAM, LPARAM);
   #else
   LRESULT WINAPI CallWindowProc(FARPROC, HWND, UINT, WPARAM, LPARAM);
   #endif

In the case that STRICT is not defined, the _afxPrevClipboardWndProc variable does not match the type of the first argument to CallWindowProc, and the error is generated.

RESOLUTION

Modify line 692 in OLEDOBJ2.CPP to provide the correct declaration by using preprocessor directives. For example:

   #ifdef STRICT
   WNDPROC NEAR _afxPrevClipboardWndProc;
   #else
   FARPROC NEAR _afxPrevClipboardWndProc;
   #endif

STATUS

Microsoft has confirmed this to be a bug in the Microsoft Foundation Classes for Windows, version 2.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: NOSTRICT library build 1.50 2.50
KBCategory: kbprg kbbuglist
KBSubcategory: MfcMisc
Keywords : kb16bitonly
Technology : kbMfc


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 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.