Much of the extensibility of ArcGIS relies on Component Object Model (COM) categories, for example, all ArcMap commands and tools are registered in the Esri Mx Commands component category.
The following are various methods for registering a .NET component in a category:
- Add code to your .NET classes, which automatically registers the classes in a component category when the component is registered with COM.
- Use the ArcGIS Component Category Registrar dialog box, which is part of the ArcGIS Visual Studio integrated development environment (IDE) Integration Framework, to add code to your classes and automatically register them to component categories. This dialog box uses classes from the ESRI.ARCGIS.ADF.Local assembly to help perform the registrations. For more information, see ArcGIS Component Category Registrar dialog box and ArcGIS Visual Studio IDE Integration Framework for extending ArcObjects.
- Use the Customize dialog box in ArcGIS applications to add commands, tools, and toolbars. Click the Add from File button on this dialog box to browse for the type library (.tlb) file created for your customization, then open it, which allows the ArcGIS Framework to add selected classes in the type library to the applicable component category.
- This method is beneficial if you want to use an existing compiled component that contains command items (commands, tools, and toolbars) but does not have automatic registration code.
For .NET components, select the type library instead of the .dll file.
- Use the Component Categories Manager (categories.exe) utility. In this case, select the applicable component category in the utility, browse for the type library, and choose the appropriate class. The utility can be found in the bin folder of your ArcGIS for Desktop installation.
- This method can be beneficial if you want to use an existing compiled component that contains custom classes but does not have automatic registration code.
Using categories.exe does not require the esriRegAsm (available at ArcGIS 10) step to be completed. Although it can register for both ArcGIS for Desktop and ArcGIS Engine products, it is only available with an ArcGIS for Desktop installation. In addition, the type library file (.tlb) needs to live beside the .dll file from which it was created.
The actions performed are essentially the same, regardless of the category registration method you choose.
See Also:How to register COM components