ArcGIS SDK  

Add-Ins

ESRI Automatic References

When you develop with Visual Basic, you must reference all the external type libraries in order for the compiler to locate all the object types, interface types, and so on. The intellisense mechanism also makes use of this type library information.

When developing ArcObjects-based applications, you’ll normally need to load many of the ArcGIS type libraries, for example the ESRI System Object Library (esriSystem.olb) and the ESRI Carto Object Library (esriCarto.olb).

Normally, to add references to external libraries in Visual Basic you would display the References dialog box in the Visual Basic Project menu, then check on the required libraries. Depending on the number of libraries installed on your system, it can take a few seconds to display the References dialog box and locate the appropriate libraries. This Visual Basic add-in simplifies the process, and can automate this reference setting for all Visual Basic Projects.

To access the add-in, click ESRI Automatic References on the Add-Ins menu in Visual Basic. Only the ArcObjects type libraries are listed in the interface. Below is the add-in’s user interface.

This dialog box is displayed faster than the Visual Basic Reference dialog box, making it the interface of choice when setting references to ESRI type libraries.

Options menu

The Remove unchecked references option, if enabled, removes from the project those references that have not been checked in the lists. If this option is disabled, no references are removed from the project.

The Set on project open option, if enabled, adds the checked references to any projects that are opened or created (as long as the Automatic References add-in is loaded). If this option is disabled, the checked references are only added to the currently active project.

The states of the items on the Options menu are saved in the registry, and loaded on subsequent uses of the tool. By default, these options are disabled.

Common library groupings buttons

If you open the VBA environment of one of the ArcGIS applications, for example ArcMap, a standard set of references to ESRI type libraries is already set up. To duplicate these groupings of libraries, use the ArcMap, ArcCatalog, ArcScene and ArcGlobe buttons on the add-in dialog. The Engine button turns on all the libraries that are part of ArcGIS Engine.

ArcGIS Controls

ActiveX controls are normally added to the Visual Basic environment with the Components dialog. Selected controls are then available from the Visual Basic ToolBox. This add-in simplifies adding the ESRI ActiveX controls (for example the MapControl) by allowing you add them at the same time as adding references to the ESRI type libraries.

How to set up the ESRI VB6 add-ins