次の方法で共有


IDebugMessageEvent2

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

This interface is used by the debug engine (DE) to send a message to Visual Studio that requires a response from the user.

Syntax

IDebugMessageEvent2 : IUnknown

Notes for Implementers

The DE implements this interface to send a message to Visual Studio that requires a user response. The IDebugEvent2 interface must be implemented on the same object as this interface. The SDM uses QueryInterface to access the IDebugEvent2 interface.

The implementation of this interface must communicate Visual Studio's call of SetResponse to the DE. For example, this can be done with a message posted to the DE's message handling thread, or the object implementing this interface could hold a reference to the DE and call back to the DE with the response passed into IDebugMessageEvent2::SetResponse.

Notes for Callers

The DE creates and sends this event object to display a message to the user that requires a response. The event is sent by using the IDebugEventCallback2 callback function that is supplied by the SDM when it is attached to the program being debugged.

Methods in Vtable Order

The following table shows the methods of IDebugMessageEvent2.

Method Description
GetMessage Gets the message to be displayed.
SetResponse Sets the response, if any, from the message box.

Remarks

The DE will use this interface if it requires a specific response from the user for a particular message. For example, if the DE gets an "Access Denied" message after an attempt to remotely attach to a program, the DE sends this particular message to Visual Studio in an IDebugMessageEvent2 event with the message box style MB_RETRYCANCEL. This allows the user to retry or cancel the attach operation.

The DE specifies how this message is to be handled by following the conventions of the Win32 function MessageBox (see AfxMessageBox for details).

Use the IDebugErrorEvent2 interface to send messages to Visual Studio that do not require a response from the user.

Requirements

Header: msdbg.h

Namespace: Microsoft.VisualStudio.Debugger.Interop

Assembly: Microsoft.VisualStudio.Debugger.Interop.dll

See also