Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IOleCommandTarget.Exec Method

Executes the specified command.

Namespace:  Microsoft.VisualStudio.OLE.Interop
Assembly:  Microsoft.VisualStudio.OLE.Interop (in Microsoft.VisualStudio.OLE.Interop.dll)

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.

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft