IOleCommandTarget.Exec(Guid, UInt32, UInt32, IntPtr, IntPtr) IOleCommandTarget.Exec(Guid, UInt32, UInt32, IntPtr, IntPtr) IOleCommandTarget.Exec(Guid, UInt32, UInt32, IntPtr, IntPtr) 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 :  * 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 Guid Guid Guid

The GUID of the command group.

nCmdID
UInt32 UInt32 UInt32 UInt32

The command ID.

nCmdexecopt
UInt32 UInt32 UInt32 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 IntPtr IntPtr IntPtr

The input arguments of the command.

pvaOut
IntPtr IntPtr IntPtr IntPtr

The output arguments of the command.

Returns

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

Applies to