共用方式為


Launch-based Attachment

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

Concepts

Sending the Required Events

Other Resources

Enabling a Program to Be Debugged