IOleCommandTarget.Exec(Guid, UInt32, UInt32, IntPtr, IntPtr) Method

Definition

Executes the specified command.

public:
 int Exec(Guid % pguidCmdGroup, System::UInt32 nCmdID, System::UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut);
public int Exec (ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut);
abstract member Exec : Guid * uint32 * uint32 * nativeint * nativeint -> int
Public Function Exec (ByRef pguidCmdGroup As Guid, nCmdID As UInteger, nCmdexecopt As UInteger, pvaIn As IntPtr, pvaOut As IntPtr) As Integer

Parameters

pguidCmdGroup
Guid

The GUID of the command group.

nCmdID
UInt32

The command ID.

nCmdexecopt
UInt32

Specifies how the object should execute the command. Possible values are taken from the OLECMDEXECOPT and Microsoft.VisualStudio.OLE.Interop.OLECMDID_WINDOWSTATE_FLAG enumerations.

pvaIn
IntPtr

The input arguments of the command.

pvaOut
IntPtr

The output arguments of the command.

Returns

Int32

This method returns S_OK on success. Other possible return values include the following.Return codeDescriptionOLECMDERR_E_UNKNOWNGROUPThe pguidCmdGroup parameter is not null but does not specify a recognized command group.OLECMDERR_E_NOTSUPPORTEDThe nCmdID parameter is not a valid command in the group identified by pguidCmdGroup.OLECMDERR_E_DISABLEDThe command identified by nCmdID is currently disabled and cannot be executed.OLECMDERR_E_NOHELPThe caller has asked for help on the command identified by nCmdID, but no help is available.OLECMDERR_E_CANCELEDThe user canceled the execution of the command.

Remarks

For information on the COM interface, see IOleCommandTarget::Exec

Applies to