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.

INTERFACES AND MEMBERS<br />

Interfaces are the access points for development with COM objects. There are<br />

inbound interfaces, which expose the properties and methods of a class, and<br />

outbound interfaces, which allow the class to interact with other classes.<br />

A detailed discussion of COM and the<br />

IUnknown interface can be found in the<br />

Microsoft Component Object Model section of<br />

Chapter 4, ‘<strong>Developer</strong> environments’.<br />

IGeometry<br />

IClone<br />

ISupportErrorInfo<br />

IPoint<br />

Geometry<br />

IGeometry : IUnknown<br />

Properties<br />

Methods<br />

Point<br />

IPoint : IGeometry<br />

Properties<br />

Methods<br />

IGeometry inherits from IUknown and, in turn,<br />

IPoint inherits from IGeometry<br />

Inbound interface<br />

Outbound interface<br />

CoClass<br />

Interface:Inherited interface<br />

Properties<br />

Methods<br />

INTERFACE INHERITANCE<br />

Since interfaces in ArcObjects are COM interfaces, they all inherit from<br />

IUnknown, the basis for COM itself. Additionally, as illustrated in the diagrams,<br />

some interfaces inherit from other ArcObjects interfaces. If one interface is<br />

inherited by another interface, then the members of the initial interface are also<br />

members of the inheriting interface. For example, since IPoint inherits from<br />

IGeometry, the members of the IGeometry interface are also members of the IPoint<br />

interface. This inheritance allows you to access the IPoint interface and use the<br />

members of IGeometry directly, without needing to query interface to the<br />

IGeometry interface.<br />

Interface inheritance is used extensively to, in effect, add functionality to existing<br />

interfaces. Although the rules of COM dictate that an interface signature, once<br />

deployed, can’t change, a new interface can be created that inherits from the<br />

original interface. For example, the IEditor2 interface extends the IEditor interface<br />

with additional members.<br />

INBOUND INTERFACES<br />

Some inbound interfaces are shown on the diagrams with special notations that<br />

provide information in addition to the usual list of members.<br />

esriSystemName<br />

The Name abstract class and the interface it<br />

implements<br />

IGxView<br />

(optional) esri-<br />

Catalog.IGx-<br />

CatalogEvents<br />

(optional) esri-<br />

Catalog.IGx-<br />

SelectionEvents<br />

(optional) IGx-<br />

ViewPrint<br />

Name<br />

GxView<br />

The GxView class includes a number of<br />

interfaces that implemented optionally.<br />

Interfaces defined in other libraries<br />

If the interface name is prefixed with a library name, such as esriSystem.IName,<br />

then the interface is inherited from a library other than the one implementing it.<br />

The library name reflects the library in which the interface is defined. In the<br />

column at left, the Name abstract class, an object in the GeoDatabase library, is<br />

shown. As shown by the library name prefix, the interface implemented by Name<br />

is actually defined in the System library.<br />

Optional interfaces<br />

Some interfaces can be inherited optionally by other classes. For example, abstract<br />

classes can have optional interfaces that may be included or excluded from<br />

its subclasses. These are designated by the prefix (Optional). If you are creating<br />

your own GxView class, you don’t need to implement the IGxViewPrint interface<br />

to be a GxView class; however, you do need to implement the IGxView interface.<br />

As a developer, if you intend to utilize an optional interface, you must verify that<br />

the interface was implemented by the object with which you are working. Attempts<br />

to access an optional interface that is not implemented will produce the<br />

446 • <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!