This document is archived and information here might be outdated. Recommended version. |
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.