Share via


IDkmVisualStudioServices.SendToVsService Method

Definition

Sends a custom message to a Visual Studio package. This can be used, for example, to drive a custom UI or make a custom UI visible by enabling a command context (IVsMonitorSelection.SetCmdUIContext).

For local 32-bit debugging, the custom message parameters (DkmCustomMessage.Parameter1/2), may contain any value (ex: object/IUnknown, string, etc), however, values are transferred between threads without marshalling, so in cases where this will not work, the sender is responsible for converting the parameter into a form which can be used from the VS service (ex: calling ole32!CoMarshalInterThreadInterfaceInStream).

For remote debugging, and 64-bit debugging, the custom message parameters are marshalled across machines, and so the restrictions describe in the DkmCustomMessage.Parameter1 documentation applies.

public:
 void SendToVsService(Microsoft::VisualStudio::Debugger::DkmCustomMessage ^ customMessage, Guid vsService, bool isBlocking);
public void SendToVsService (Microsoft.VisualStudio.Debugger.DkmCustomMessage customMessage, Guid vsService, bool isBlocking);
abstract member SendToVsService : Microsoft.VisualStudio.Debugger.DkmCustomMessage * Guid * bool -> unit
Public Sub SendToVsService (customMessage As DkmCustomMessage, vsService As Guid, isBlocking As Boolean)

Parameters

customMessage
DkmCustomMessage

[In] Message structure used to pass information between custom debugger backend components and custom visual studio UI components (packages, add-ins, etc).

vsService
Guid

[In] Visual Studio service that this event should be sent to. A VS package must register this service id. The service class must implement the IVsCustomDebuggerEventHandler110 interface. Services can be registered in the registry ($RootKey$\Services{VsService}), or through the VS shell IProfferService interface. Registry keys may be set through .pkgdef files. If the service should be called even if it is not already loaded, then the registry approach should be used. If the service should only be called if it has already been started, then IProfferService should be used.

isBlocking
Boolean

[In] True if SendToPackage should block waiting for the package to finish processing this message.

Note that before Visual Studio 2015, when true, DkmCustomMessage.Process must be non-null. This requirement was dropped in Visual Studio 2015.

Applies to