ArcGIS Developer Help  (Controls)    

HookHelper CoClass

HookHelper class helping commands to work with different controls and applications.

Product Availability

Available with ArcGIS Engine.


The HookHelper is designed to help developers write custom commands that will work with some ArcGIS Controls and applications.

When creating a custom command the ICommand::OnCreate event is passed a hook to the control or application that the command will work with. The command needs to determine the type of hook that is passed so it knows how to handle itself. Rather than adding code into the ICommand::OnCreate event to determine the type of hook a HookHelper object can do this. The HookHelper is used to hold the hook and return the IActiveView, PageLayout or FocusMap regardless of whether the hook is a MapControl, PageLayoutControl, ToolbarControl (with a 'buddy' MapControl or PageLayoutControl), the ArcMap application or a custom control or application implementing ICommandHook.

When using the HookHelper in the ICommand::OnCreate event of custom commands the following must be considered:

Extended Error Information

Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.


Interfaces Description
IHookHelper Provides access to members commonly used when developing commands.
ISupportErrorInfo Indicates whether a specific interface can return Automation error objects.


Feedback Send feedback on this page