This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > SystemUI > ESRI.ArcGIS.SystemUI > Interfaces > IC > ICommandHost Interface > ICommandHost.SetCommand Method (ArcObjects .NET 10.5 SDK) |
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
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.