DOCUMENT:Q116167 26-JUL-2001 [visualc] TITLE :FIX: Visual Workbench Cannot Find WndProc in Windows 3.1 Apps PRODUCT :Microsoft C Compiler PROD/VER: OPER/SYS: KEYWORDS:kbDebug kbidekbbuglist kbfixlist ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - The Visual Workbench Integrated Debugger, used with: - Microsoft Visual C++, versions 1.0, 1.5 - *EDITOR Please do not choose this product*Microsoft Visual C++ 32-bit Edition* use 241, 265, 225, version 1.0 ------------------------------------------------------------------------------- SYMPTOMS ======== The Visual Workbench debugger allows you to set a breakpoint in a window procedure. This makes it possible for the application being debugged to break in the function when a specific message or class of messages is received. If the Windows version 3.1 prototype is used for the window procedure, the Visual Workbench is not able to identify the function as a window procedure. As a result, the WndProc list box in the Breakpoints dialog box that lists the available window procedures does not list the function. CAUSE ===== The Visual Workbench uses the Windows version 3.0 WndProc prototype, which reads as follows: long _far _pascal WndProc(WORD, WORD, WORD, LONG) The Windows version 3.1 WndProc prototype is slightly different: long _far _pascal WndProc(HWND, UINT, WPARAM, LPARAM) When the Windows version 3.1 prototype is used, the Visual Workbench is not able to find the WndProc function. RESOLUTION ========== Even though it is not possible to select the window procedure to break in from the WndProc list box in the Breakpoints dialog box, it is possible to manually enter the name of the function. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ version 2.0. MORE INFORMATION ================ To reproduce the problem, do the following: 1. Build a debug version of any of the Windows samples provided with Visual C++. 2. When the build is completed, choose Breakpoints from the Debug menu. 3. In the Type field, choose "Break at WndProc if Message is Received". The second item in the dialog box will change to "WndProc"; however, the list box will not contain any Windows procedures. Additional query words: 1.00 1.50 ====================================================================== Keywords : kbDebug kbide kbbuglist kbfixlist Technology : kbVCsearch kbAudDeveloper Issue type : kbbug Solution Type : kbfix ============================================================================= 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. Copyright Microsoft Corporation 2001.