IOleCommandTarget.Exec Method (Guid, UInt32, UInt32, IntPtr, IntPtr)
Executes the specified command.
Assembly: Microsoft.VisualStudio.OLE.Interop (in Microsoft.VisualStudio.OLE.Interop.dll)
int Exec( [InAttribute] ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut )
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 T:Microsoft.VisualStudio.OLE.Interop.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.Int32This 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. |
For information on the COM interface, see A2071CA9-8675-4F53-B30E-8C7198C2ACCA