Microsoft KB Archive/199058

= BUG: Debugger.SetNextStatement Displays Dialog Box =

Article ID: 199058

Article Last Modified on 12/11/2003

-

APPLIES TO


 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition
 * Microsoft Visual J++ 1.0 Standard Edition
 * Microsoft Visual J++ 1.1 Standard Edition
 * Microsoft Visual InterDev 1.0 Standard Edition

-



This article was previously published under Q199058



SYMPTOMS
When you are automating the MSDEV.exe Debugger object, the SetNextStatement method displays the following message:

This operation will move the current location to a different function.



CAUSE
The target line number of the SetNextStatement method is outside the scope of the current function. The message is not suppressed during automation.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
The error message alerts the operator that this action, while permitted, might cause unexpected behavior. It appears normally when you click Set Next Statement from the debugger's shortcut menu to move the code execution location to another function. However, during automation, this sort of informational message box should never appear.

Steps to Reproduce Behavior
 Create a default MFC .exe application. Name it SetNext. From the ClassView window, expand the CSetNextDoc class. Double-click CSetNextDoc.  Click on the curly brace at the beginning of the function (at or near line 31). Press the F9 key once to set a breakpoint there. The code should look something like the following:

... 30: CSetNextDoc::CSetNextDoc 31:>{ 32:   // TODO: add one-time construction code here 33: } 34: 35: CSetNextDoc::~CSetNextDoc 36: { 37: } ... The line numbers are added for illustration only. The > represents a line with a set breakpoint.   Create a Visual Basic Script macro named SetNext. To do this, go to the Tools menu, click Macro, type SetNext in the Macro Name field, and click Edit. Click OK on the Add Macro dialog box. Replace the SetNext subroutine with the following text and press Ctrl+S to save the macro file: Sub SetNext Debugger.RunToCursor Debugger.SetNextStatement 36, "SetNextDoc.cpp" End Sub In this example, 36 represents a valid line in another function of the same source file of the SetNext application.  On the File menu, click Close. This closes the Macro window. Execute the SetNext VBScript macro. To do this, go to the Tools menu, click Macro, click OK on any informational dialog boxes, and double-click SetNext in the Macro Name list.</li></ol>

RESULT: The message described in the SYMPTOMS section appears. Click OK to dismiss it. On the Debug menu, click Stop Debugging.

Keywords: kbbug kbvcobj kbide kbautomation kbdevstudio KB199058

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.