共用方式為


LanguageService.DispatchCommand Method

Definition

Overloads

DispatchCommand(Guid, UInt32, IntPtr, IntPtr)

Called to execute the specified command.

DispatchCommand(Guid, UInt32, UInt32, IntPtr, IntPtr)

Executes the given command if it is enabled and supported using the current SUIHostCommandDispatcher.

DispatchCommand(Guid, UInt32, IntPtr, IntPtr)

Called to execute the specified command.

public:
 int DispatchCommand(Guid cmdGuid, System::UInt32 cmdId, IntPtr pvaIn, IntPtr pvaOut);
public int DispatchCommand (Guid cmdGuid, uint cmdId, IntPtr pvaIn, IntPtr pvaOut);
member this.DispatchCommand : Guid * uint32 * nativeint * nativeint -> int
Public Function DispatchCommand (cmdGuid As Guid, cmdId As UInteger, pvaIn As IntPtr, pvaOut As IntPtr) As Integer

Parameters

cmdGuid
Guid

[in] The GUID of the command to execute.

cmdId
UInt32

[in] The ID of the command to execute.

pvaIn
IntPtr

nativeint

[in] A pointer to possible parameters for the command.

pvaOut
IntPtr

nativeint

[out] A pointer to a place to return the results of the command.

Returns

If successful, returns S_OK; otherwise, returns an error code.

Remarks

This method executes the specified command by getting the IOleCommandTarget interface from the SUIHostCommandDispatcher service and calling <xref:Microsoft.VisualStudio.Shell.WindowPane.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec%2A> with the given parameters, but only if the command exists and is enabled.

Applies to

DispatchCommand(Guid, UInt32, UInt32, IntPtr, IntPtr)

Executes the given command if it is enabled and supported using the current SUIHostCommandDispatcher.

public:
 int DispatchCommand(Guid cmdGuid, System::UInt32 cmdId, System::UInt32 cmdExecOpt, IntPtr pvaIn, IntPtr pvaOut);
public int DispatchCommand (Guid cmdGuid, uint cmdId, uint cmdExecOpt, IntPtr pvaIn, IntPtr pvaOut);
member this.DispatchCommand : Guid * uint32 * uint32 * nativeint * nativeint -> int
Public Function DispatchCommand (cmdGuid As Guid, cmdId As UInteger, cmdExecOpt As UInteger, pvaIn As IntPtr, pvaOut As IntPtr) As Integer

Parameters

cmdGuid
Guid

The GUID of the command.

cmdId
UInt32

The command ID.

cmdExecOpt
UInt32

The command options.

pvaIn
IntPtr

nativeint

The in parameters.

pvaOut
IntPtr

nativeint

The out parameters

Returns

The HRESULT.

Applies to