18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DEVELOPING WITH A RCOBJECTS<br />

The Customize dialog box in ArcMap and<br />

ArcCatalog<br />

The Component Category Manager<br />

Now that you’ve seen two uses of component categories, you will see how to get<br />

your classes registered into the correct component category. Development environments<br />

have various levels of support for component categories; ESRI provides<br />

two ways of adding classes to a component category. The first can only be<br />

used for commands and command bars that are added to either ArcMap or<br />

ArcCatalog. Using the Add From File button on the Customize dialog box<br />

(shown on the left), it is possible to choose a server. All classes in that server are<br />

then added to either the ESRI Gx Commands or the ESRI Mx Commands,<br />

depending on the application being customized. Although this utility is useful, it<br />

is limited since it adds all the classes found in the server. It is not possible to<br />

remove classes, and it only supports two of the many component categories<br />

implemented within ArcObjects.<br />

Distributed with <strong>ArcGIS</strong> applications is a utility application called the Component<br />

Category Manager, shown on the left. This small application allows you to<br />

add and remove classes from any of the component categories on your system,<br />

not just ArcObjects categories. Expanding a category displays a list of classes in<br />

the category. You can then use the Add Object button to display a checklist of all<br />

the classes found in the server. You check the required classes, and these checked<br />

classes are then added to the category.<br />

Using these ESRI tools is not the only method of interacting with component<br />

categories. During the installation of the server on the target user’s machine, it is<br />

possible to add the relevant information to the registry using a registry script.<br />

Below is one such script. The first line tells Windows for which version of<br />

regedit this script is intended. The last line, starting with “[HKEY_LOCAL_”,<br />

executes the registry command; all the other lines are comments in the file.<br />

REGEDIT4<br />

; This Registry Script enters coclasses into their appropriate Component<br />

Category<br />

; Use this script during installation of the components<br />

; Coclass: Exporter.ExportingExtension<br />

; CLSID: {E233797D-020B-4AD4-935C-F659EB237065}<br />

; Component Category: ESRI Mx Extensions<br />

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{E233797D-020B-4AD4-935C-<br />

F659EB237065}\Implemented Categories\{B56A7C45-83D4-11D2-A2E9-080009B6F22B}]<br />

The last line in the code above is one continuous line in the script.<br />

The last method is for the self-registration code of the server to add the relevant<br />

classes within the server to the appropriate categories. Not all development<br />

environments allow this to be set up. Visual Basic has no support for component<br />

categories, although there is an add-in that allows this functionality. See the<br />

sections on Visual Basic developer add-ins and Active Template Library (ATL) in<br />

the <strong>ArcGIS</strong> <strong>Developer</strong> Help.<br />

78 • <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!