Provides access to the ICommandHost Interface.
Product Availability
Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.
Description
The ICommandHost interface is used when developing with the C++ API. C++ developers are unable to create new COM objects, so the CommandHost and ToolHost objects can be used to create custom commands and tools as follows:
- Create your own class that inherits from CAoCommandBase or CAoToolBase and define the ICommand and/or ITool methods. CAoCommandBase and CAoToolBase are abstract classes which have all of the ICommand/ITool methods declared.
- Create an instance of the Command/Tool and add it to a ToolbarControl using the AoToolbarAddCommand/AoToolbarAddTool function. The AoToolbarAddCommand/AoToolbarAddTool functions call ICommandHost::SetCommand which associates the custom Command/Tool with the 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.
Members
Description | ||
---|---|---|
SetCommand | The SetCommand method is used to bind a command instance to its host. |
CoClasses that implement ICommandHost
CoClasses and Classes | Description |
---|---|
CommandHost | Use this class to host C++ command implementations in a Toolbar. |
ToolHost | Use this class to host pure C++ tool implementations in a Toolbar. |