How COM inheritance impacts the components in the table of contents (ArcObjects .NET 10.6 SDK)
ArcObjects Help for .NET developers > ArcObjects namespaces > Understanding the ArcObjects namespace reference > How COM inheritance impacts the components in the table of contents (ArcObjects .NET 10.6 SDK)

How COM inheritance impacts the components in the table of contents


Summary
This topic discusses why some interface members in the table of contents (TOC) appear duplicated and others do not, and how OleView verifies the accuracy of entries in the TOC.

In this topic


About how COM inheritance impacts the components in the table of contents

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.
Verifying a COM interface
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:
  1. Type oleview at the command prompt and press Enter.
  2. When the OLE/COM Object Viewer appears, click the View TypeLib (triple red arrows) button.
  3. 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 reference
Exploring the table of contents




Development licensing Deployment licensing
ArcGIS Desktop Basic ArcGIS Desktop Basic
ArcGIS Desktop Standard ArcGIS Desktop Standard
ArcGIS Desktop Advanced ArcGIS Desktop Advanced
Engine Developer Kit Engine