BUG: Visual Workbench Misses Breakpoint at Start of WinMain

Last reviewed: July 22, 1997
Article ID: Q116314
1.00 1.50 WINDOWS kbtool kbbuglist

The information in this article applies to:

  • The Visual Workbench Integrated Debugger included with: Microsoft Visual C++ for Windows, versions 1.0 and 1.5

SYMPTOMS

The Visual Workbench debugger fails to stop at a breakpoint set on the opening brace ("{") of WinMain(). The problem only applies to the opening brace of the WinMain function.

RESOLUTION

To work around this problem, either:

  • Set a breakpoint on the first executable statement in WinMain() rather than on the opening brace.

    - or -

  • Use CodeView for Windows to debug the application because CodeView for Windows accepts the breakpoint.

STATUS

Microsoft has confirmed this to be a bug in Microsoft Visual WorkBench for Windows, versions 1.0 and 1.5. We are researching this problem and will post new information in the Microsoft Knowledge Base as it becomes available.

This problem does not occur in Visual WorkBench 32-bit, version 1.1.

MORE INFORMATION

The sample code below demonstrates the problem, but you can use any Windows application that contains debug information and a WinMain procedure to reproduce this problem: Set a breakpoint on the opening brace and on the return statement. Then choose Go from the Debug menu. The debugger skips the first breakpoint and stops on the return statement.

Sample Code

/* Compile options needed: /Zi /Od
*/

   #include <windows.h>

   int PASCAL WinMain(HINSTANCE hinstCurrent, HINSTANCE hinstPrevious,
       LPSTR lpszCmdLine, int nCmdShow)
   {
        return 0;
   }


Additional reference words: 1.00 1.50
KBCategory: kbtool kbbuglist
KBSubcategory: WBDebug
Keywords : kb16bitonly


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.