Share via


Launch-based Attachment

Note

This article applies to Visual Studio 2015. 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

Launch-based attachment to a program is automatic. When the process hosting the program is launched by the SDM, launch-based attachment follows a path similar to that of the manual attachment method. For information, see Attaching to the Program.

The Attaching Process

The main difference is the sequence of events following the Attach call, as follows:

  1. Send an IDebugEngineCreateEvent2 event object to the SDM. For details, see Sending Events.

  2. Call the IDebugProgram2::GetProgramId method on the IDebugProgram2 interface passed to the Attach method.

  3. Send an IDebugProgramCreateEvent2 event object to notify the SDM that the local IDebugProgram2 object was created to represent the program to the DE.

  4. Send an IDebugThreadCreateEvent2 event object to notify the SDM that a new thread is created for the process that launched.

See Also

Sending the Required Events
Enabling a Program to Be Debugged