LanguageService.DispatchCommand Method (Guid, UInt32, IntPtr, IntPtr)
Called to execute the specified command.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'宣言
Public Function DispatchCommand ( _
cmdGuid As Guid, _
cmdId As UInteger, _
pvaIn As IntPtr, _
pvaOut As IntPtr _
) As Integer
'使用
Dim instance As LanguageService
Dim cmdGuid As Guid
Dim cmdId As UInteger
Dim pvaIn As IntPtr
Dim pvaOut As IntPtr
Dim returnValue As Integer
returnValue = instance.DispatchCommand(cmdGuid, _
cmdId, pvaIn, pvaOut)
public int DispatchCommand(
Guid cmdGuid,
uint cmdId,
IntPtr pvaIn,
IntPtr pvaOut
)
public:
int DispatchCommand(
Guid cmdGuid,
unsigned int cmdId,
IntPtr pvaIn,
IntPtr pvaOut
)
member DispatchCommand :
cmdGuid:Guid *
cmdId:uint32 *
pvaIn:IntPtr *
pvaOut:IntPtr -> int
public function DispatchCommand(
cmdGuid : Guid,
cmdId : uint,
pvaIn : IntPtr,
pvaOut : IntPtr
) : int
Parameters
- cmdGuid
Type: System.Guid
[in] The GUID of the command to execute.
- cmdId
Type: System.UInt32
[in] The ID of the command to execute.
- pvaIn
Type: System.IntPtr
[in] A pointer to possible parameters for the command.
- pvaOut
Type: System.IntPtr
[out] A pointer to a place to return the results of the command.
Return Value
Type: System.Int32
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 Exec(Guid%, UInt32, UInt32, IntPtr, IntPtr) with the given parameters, but only if the command exists and is enabled.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.