BUG: Visual Workbench Misses Breakpoint at Start of WinMain
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
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