Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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
Attaches to the program.
HRESULT Attach(
IDebugEventCallback2* pCallback
);
int Attach(
IDebugEventCallback2 pCallback
);
pCallback
[in] An IDebugEventCallback2 object to be used for debug event notification.
If successful, returns S_OK
; otherwise, returns an error code. The following table shows some possible error codes.
Value | Description |
---|---|
E_ATTACH_DEBUGGER_ALREADY_ATTACHED |
The specified program is already attached to the debugger. |
E_ATTACH_DEBUGGEE_PROCESS_SECURITY_VIOLATION |
A security violation occurred during the attach procedure. |
E_ATTACH_CANNOT_ATTACH_TO_DESKTOP |
A desktop program cannot be attached to the debugger. |
A debug engine (DE) never calls this method to attach to a program. If the DE runs in the program's address space, the OnAttach method is called. If the DE runs in the session debug manager's (SDM) address space, the Attach method is called.