IOleCommandTarget.Exec Method
Executes the specified command.
Namespace: Microsoft.VisualStudio.OLE.Interop
Assembly: Microsoft.VisualStudio.OLE.Interop (in Microsoft.VisualStudio.OLE.Interop.dll)
Syntax
'Déclaration
Function Exec ( _
ByRef pguidCmdGroup As Guid, _
nCmdID As UInteger, _
nCmdexecopt As UInteger, _
pvaIn As IntPtr, _
pvaOut As IntPtr _
) As Integer
'Utilisation
Dim instance As IOleCommandTarget
Dim pguidCmdGroup As Guid
Dim nCmdID As UInteger
Dim nCmdexecopt As UInteger
Dim pvaIn As IntPtr
Dim pvaOut As IntPtr
Dim returnValue As Integer
returnValue = instance.Exec(pguidCmdGroup, _
nCmdID, nCmdexecopt, pvaIn, pvaOut)
int Exec(
ref Guid pguidCmdGroup,
uint nCmdID,
uint nCmdexecopt,
IntPtr pvaIn,
IntPtr pvaOut
)
int Exec(
[InAttribute] Guid% pguidCmdGroup,
[InAttribute] unsigned int nCmdID,
[InAttribute] unsigned int nCmdexecopt,
[InAttribute] IntPtr pvaIn,
[InAttribute] IntPtr pvaOut
)
abstract Exec :
pguidCmdGroup:Guid byref *
nCmdID:uint32 *
nCmdexecopt:uint32 *
pvaIn:IntPtr *
pvaOut:IntPtr -> int
function Exec(
pguidCmdGroup : Guid,
nCmdID : uint,
nCmdexecopt : uint,
pvaIn : IntPtr,
pvaOut : IntPtr
) : int
Parameters
- pguidCmdGroup
Type: System.Guid%
The GUID of the command group.
- nCmdID
Type: System.UInt32
The command ID.
- nCmdexecopt
Type: System.UInt32
Specifies how the object should execute the command. Possible values are taken from the OLECMDEXECOPT and OLECMDID_WINDOWSTATE_FLAG enumerations.
- pvaIn
Type: System.IntPtr
The input arguments of the command.
- pvaOut
Type: System.IntPtr
The output arguments of the command.
Return Value
Type: System.Int32
This method returns S_OK on success. Other possible return values include the following.
Return code |
Description |
OLECMDERR_E_UNKNOWNGROUP |
The pguidCmdGroup parameter is not null but does not specify a recognized command group. |
OLECMDERR_E_NOTSUPPORTED |
The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup. |
OLECMDERR_E_DISABLED |
The command identified by nCmdID is currently disabled and cannot be executed. |
OLECMDERR_E_NOHELP |
The caller has asked for help on the command identified by nCmdID, but no help is available. |
OLECMDERR_E_CANCELED |
The user canceled the execution of the command. |
Remarks
For information on the COM interface, see IOleCommandTarget::Exec
.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.