This document is archived and information here might be outdated.  Recommended version.


ICommandHost.SetCommand Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (SystemUI)  

ICommandHost.SetCommand Method

The SetCommand method is used to bind a command instance to its host.

[Visual Basic .NET]
Public Sub SetCommand ( _
    ByRef commandInstance As Object _
)
[C#]
public void SetCommand (
    ref object commandInstance
);
[C++]
HRESULT SetCommand(
  VARIANT* commandInstance
);
[C++]

Parameters commandInstance [in] commandInstance is a parameter of type VARIANT

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The SetCommand method is used when developing with the C++ API, and is called by the AoToolbarAddCommand and AoToolbarAddTool functions. It associates a custom Command/Tool with an instance of the CommandHost/ToolHost. Whenever an ICommand/ITool method on the CommandHost/ToolHost gets called it uses the pointer to forward the call to the custom Command/Tool.

See Also

ICommandHost Interface