Microsoft KB Archive/117795

From BetaArchive Wiki

BUG: MFC Library Build Fails with NOSTRICT Defined

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
Issue type : kbbug
Technology : kbAudDeveloper kbMFC


Last Reviewed: May 5, 2001
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.