In this topic
ArcObjects follow the Component Object Model (COM) paradigm of adding additional functionality to objects by creating new interfaces.
When you navigate through the table of contents (TOC), you may discover that some members (that is, properties and methods) display as duplications for different versions of an interface, but not duplicated at other times.
To fully understand this topic, examine the ESRI.ArcGIS.ArcMapUI namespace and the IAddDataDialog and IDataConnectionPropertyPage interfaces. Both interfaces have a "second version" (a 2 appended to the interface name) that adds additional functionality in some of the associated members. In this example, the second versions are IAddDataDialog2 and IDataConnectionPropertyPage2.
However, by looking closer at the available members for each of the second version interfaces, you will notice that some members in the IDataConnectionPropertyPage2 interface are duplicated from IDataConnectionPropertyPage, but IAddDataDialog2 only shows new members beyond what is available in IAddDataDialog.
The following illustration compares the four interfaces in this example:
The versioned interfaces look different in the TOC because of how the original COM objects were created. The IAddDataDialog2 interface was created using the COM paradigm of inheriting all of its functionality from the IAddDataDialog interface and adding new functionality for the desired member.
In contrast, the IDataConnectionPropertyPage2 interface was originally created to have all the same member names and signature of the IDataConnectionPropertyPage interface, but it did not inherit from it.
All ArcObjects inherit from IUnknown or IDispatch, which are generic to all COM objects.
You can verify what a COM interface inherits its functionality from by using Microsoft's OleView tool. OleView comes with Visual Studio and can be started by opening a Visual Studio command prompt. See the following screen shot:
Do the following to open the necessary .olb file:
- Type oleview at the command prompt and press Enter.
- When the OLE/COM Object Viewer appears, click the View TypeLib (triple red arrows) button.
- When the Open dialog box appears, navigate to and open the necessary .olb file—for example, C:\Program Files\ArcGIS\Desktop10.0\com\esriArcMapUI.olb.
See the following screen shot:
After you click Open in the preceding screen shot, the following shows in the ITypeLib Viewer. The ITypeLib Viewer shows how IAddDataDialog2 and IDataConnectionPropertyPage2 compare in their inheritance structure when viewed in OleView:
As OleView demonstrates, IAddDataDialog2 inherits all interfaces from IAddDataDialog. This corresponds exactly to the TOC in the ArcObjects namespace reference. Likewise, OleView shows that IDataConnectionPropertyPage2 has all member names explicitly created and is not inherited from IDataConnectionPropertyPage.
Both methods of creating versioned interfaces are acceptable in the COM paradigm and should enable your application to have longevity when newer functionality is added.
See Also:
Understanding the ArcObjects namespace referenceExploring the table of contents
Development licensing | Deployment licensing |
---|---|
ArcGIS for Desktop Basic | ArcGIS for Desktop Basic |
ArcGIS for Desktop Standard | ArcGIS for Desktop Standard |
ArcGIS for Desktop Advanced | ArcGIS for Desktop Advanced |
Engine Developer Kit | Engine |