| ArcGIS Developer Help (GlobeCore) |
|
GlobeHookHelper class helping commands to work with GlobeControl, ArcGlobe, custom controls and applications.
Product Availability
Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.
Description
The GlobeHookHelper 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 GlobeHookHelper object can do this. The GlobeHookHelper is used to hold the hook and return the Globe, GlobeDisplay, ISceneViewer and Camera objects regardless of whether the hook is a GlobeControl, ToolbarControl (with a 'buddy' GlobeControl), the ArcGlobe application or a custom control or application implementing IGlobeCommandHook.
When using the GlobeHookHelper in the ICommand::OnCreate event of custom commands the following must be considered:
- Use the GlobeHookHelper when the command is to support a variety of hook objects. If the command is to support one type of hook object only (e.g. a command that only works with IGMxApplication in ArcGlobe) the GlobeHookHelper does not offer anything over a simple interface pointer stored as a member variable in the command implementation.
- The GlobeHookHelper is useful for writing ArcGIS Engine commands as it can handle the GlobeControl or the ToolbarControl passed as a hook. In the case of the ToolbarControl, the HookHelper contains the logic for testing the ToolbarControl's Buddy to retieve Globe, GlobeDisplay, ISceneViewer and Camera objects.
- If the custom command is to work with the ArcGIS Controls on an ArcGIS Engine installation and inside the ArcGlobe desktop application, the GlobeHookHelper can provide generic access to Globe, GlobeDisplay, ISceneViewer and Camera objects. There is a good chance an Engine command that starts from these objects will also work within ArcGlobe, providing that the IToolbarControl interface and other ArcGIS Control specific interfaces have not been used.
- If the custom command requires the use of additional objects and interfaces that are only present in an ArcGlobe Desktop installation, then ArcGlobe must be installed in order for these references to be resolved and for the code to compile. If the command makes use of desktop only objects the command will not work on a machine with only an ArcGIS Engine installation. One possible solution is for the command logic to test whether the hook object is a type of ArcGIS Control, and if so provide an alternative implemetation for an ArcGIS Engine only installation.
Supported Platforms
Windows, Solaris, Linux
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
|
Interfaces |
Description |
| IGlobeHookHelper |
Provides access to members needed when developing commands working with GlobeControl, ArcGlobe, custom controls and applications. |
| ISupportErrorInfo |
Indicates whether a specific interface can return Automation error objects. |
Send feedback on this page