IDebugProgram3::ExecuteOnThread

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Executes the debugger program. The thread is returned to give the debugger information on which thread the user is viewing when executing the program.

Syntax

HRESULT ExecuteOnThread(
   [in] IDebugThread2* pThread)
int ExecuteOnThread(
   IDebugThread2 pThread
);

Parameters

pThread
[in] An IDebugThread2 object.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Remarks

There are three different ways that a debugger can resume execution after stopping:

  • Execute: Cancel any previous step, and run until the next breakpoint and so on.

  • Step: Cancel any old step, and run until the new step completes.

  • Continue: Run again, and leave any old step active.

    The thread passed to ExecuteOnThread is useful when deciding which step to cancel. If you do not know the thread, running execute cancels all steps. With knowledge of the thread, you only need to cancel the step on the active thread.

See also