Sdílet prostřednictvím


DkmCustomMessage.SendToVsService(Guid, Boolean) 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(Guid VsService, bool IsBlocking);
public void SendToVsService (Guid VsService, bool IsBlocking);
member this.SendToVsService : Guid * bool -> unit
Public Sub SendToVsService (VsService As Guid, IsBlocking As Boolean)

Parameters

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