HierarchyNode.Exec Method

Executes the specified non-UI command or displays help for a command.

Namespace:  Microsoft.VisualStudio.Package
Assembly:  MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)

Syntax

'宣言
Public Overridable Function Exec ( _
    ByRef guidCmdGroup As Guid, _
    nCmdId As UInteger, _
    nCmdExecOpt As UInteger, _
    pvaIn As IntPtr, _
    pvaOut As IntPtr _
) As Integer
'使用
Dim instance As HierarchyNode
Dim guidCmdGroup As Guid
Dim nCmdId As UInteger
Dim nCmdExecOpt As UInteger
Dim pvaIn As IntPtr
Dim pvaOut As IntPtr
Dim returnValue As Integer

returnValue = instance.Exec(guidCmdGroup, _
    nCmdId, nCmdExecOpt, pvaIn, pvaOut)
public virtual int Exec(
    ref Guid guidCmdGroup,
    uint nCmdId,
    uint nCmdExecOpt,
    IntPtr pvaIn,
    IntPtr pvaOut
)
public:
virtual int Exec(
    Guid% guidCmdGroup, 
    unsigned int nCmdId, 
    unsigned int nCmdExecOpt, 
    IntPtr pvaIn, 
    IntPtr pvaOut
)
public function Exec(
    guidCmdGroup : Guid, 
    nCmdId : uint, 
    nCmdExecOpt : uint, 
    pvaIn : IntPtr, 
    pvaOut : IntPtr
) : int

Parameters

  • guidCmdGroup
    Type: System.Guid%

    Unique identifier of the command group.

  • nCmdId
    Type: System.UInt32

    The command to be executed. This command must belong to the group specified under guidCmdGroup.

  • nCmdExecOpt
    Type: System.UInt32

    Values taken from the OLECMDEXECOPT enumeration, which describe how the object should execute the command.

  • pvaIn
    Type: System.IntPtr

    Pointer to a VARIANTARG structure that contains input arguments. Can be a null reference (Nothing in Visual Basic).

  • pvaOut
    Type: System.IntPtr

    Pointer to a VARIANTARG structure to receive command output. Can be a null reference (Nothing in Visual Basic).

Return Value

Type: System.Int32

This method supports the standard return values E_FAIL and E_UNEXPECTED, and also the following values:

  • S_OK
    The command was executed successfully.

  • OLECMDERR_E_UNKNOWNGROUP
    The guidCmdGroup parameter is not a null reference (Nothing in Visual Basic), but does not specify a recognized command group.

  • OLECMDERR_E_NOTSUPPORTED
    The nCmdId parameter is not a valid command in the group identified by guidCmdGroup.

  • 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.

Implements

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

Permissions

See Also

Reference

HierarchyNode Class

HierarchyNode Members

Microsoft.VisualStudio.Package Namespace