Collapse the table of content
Expand the table of content



The debug engine (DE) sends this interface to the session debug manager (SDM) when an exception is thrown in the program currently being executed.

IDebugExceptionEvent2 : IUnknown

The DE implements this interface to report that an exception has occurred in the program being debugged. The IDebugEvent2 interface must be implemented on the same object as this interface. The SDM uses QueryInterface to access the IDebugEvent2 interface.

The DE creates and sends this event object to report an exception. The event is sent using the IDebugEventCallback2 callback function that is supplied by the SDM when it attached to the program being debugged.

The following table shows the methods of IDebugExceptionEvent2.




Gets detailed information about the exception that fired this event.


Gets a human-readable description for the exception thrown that fired this event.


Determines whether or not the debug engine (DE) supports the option of passing this exception to the program being debugged when execution resumes.


Specifies whether the exception should be passed on to the program being debugged when execution resumes, or if the exception should be discarded.


Header: msdbg.h

Namespace: Microsoft.VisualStudio.Debugger.Interop

Assembly: Microsoft.VisualStudio.Debugger.Interop.dll

Before sending the event, the DE checks to see if this exception event has been designated a first-chance or second-chance exception by a previous call to IDebugEngine2::SetException. If it has been designated to be a first-chance exception, the IDebugExceptionEvent2 event is sent to the SDM. If not, the DE gives the application a chance to handle the exception. If no exception handler is provided, and if the exception has been designated as a second-chance exception, the IDebugExceptionEvent2 event is sent to the SDM. Otherwise, the DE resumes execution of the program, and the operating system or runtime handles the exception.

© 2015 Microsoft