ViewFilter.IOleCommandTarget.Exec Method

Definition

Handles execution of a supported command.

 virtual int Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec(Guid % guidCmdGroup, System::UInt32 nCmdId, System::UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) = Microsoft::VisualStudio::OLE::Interop::IOleCommandTarget::Exec;
int IOleCommandTarget.Exec (ref Guid guidCmdGroup, uint nCmdId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut);
abstract member Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec : Guid * uint32 * uint32 * nativeint * nativeint -> int
override this.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.Exec : Guid * uint32 * uint32 * nativeint * nativeint -> int
Function Exec (ByRef guidCmdGroup As Guid, nCmdId As UInteger, nCmdexecopt As UInteger, pvaIn As IntPtr, pvaOut As IntPtr) As Integer Implements IOleCommandTarget.Exec

Parameters

guidCmdGroup
Guid

[in] The GUID of the command group.

nCmdId
UInt32

[in] The specific ID of the command from the command group. This identifies the command to execute.

nCmdexecopt
UInt32

[in] Additional parameters for the command (packed into a 32-bit value).

pvaIn
IntPtr

nativeint

[in] An unmarshaled pointer to a Variant object holding any parameters required by the command. This can be a null value indicating there are no additional parameters.

pvaOut
IntPtr

nativeint

[in, out] An unmarshaled pointer to a Variant object to hold the result of the command, if any.

Returns

If successful, returns S_OK; otherwise, returns an error code. If a particular command is not supported, returns OLECMDERR_E_NOTSUPPORTED.

Implements

Remarks

This method is responsible for handling any supported commands.. This method is called in response to any command given by the user, from a key press to a menu or toolbar selection. This is where the language service handles support for IntelliSense and any other operations that require interaction with the user's actions (such as smart indenting).

This is an implementation of the Exec method on the IOleCommandTarget interface.

The base method calls the QueryParameterList method if the option OLECMDEXECOPT_SHOWHELP is specified in nCmdexecopt. Otherwise, the base method calls the CheckCaretPosition method on the TextTipData object if the tool tip is active, then the base method calls the ExecCommand method. If ExecCommand returns an error then the next command target in the chain is called to try to handle the command.

Applies to