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.

THE MICROSOFT COMPONENT OBJECT MODEL<br />

Type<br />

Boolean<br />

unsigned char<br />

double<br />

float<br />

int<br />

long<br />

short<br />

BSTR<br />

CURRENCY<br />

DATE<br />

SCODE<br />

Typedef enum myenum<br />

Interface IDispatch *<br />

Interface IUnknown *<br />

dispinterface Typename *<br />

Coclass Typename *<br />

[oleautomation] interface Typename *<br />

SAFEARRAY(TypeName)<br />

TypeName*<br />

Decimal<br />

Description<br />

Data item that can have the value True or False<br />

8-bit unsigned data item<br />

64-bit IEEE floating-point number<br />

32-bit IEEE floating-point number<br />

Signed integer, whose size is system dependent<br />

32-bit signed integer<br />

16-bit signed integer<br />

Length-prefixed string<br />

8-byte, fixed-point number<br />

64-bit, floating-point fractional number of days since Dec 30, 1899<br />

For 16-bit systems - Built-in error that corresponds to VT_ERROR<br />

Signed integer, whose size is system dependent<br />

Pointer to the IDispatch interface<br />

Pointer to an interface that does not derive from IDispatch<br />

Pointer to an interface derived from IDispatch<br />

Pointer to a coclass name (VT_UNKNOWN)<br />

Pointer to an interface that derives from IDispatch<br />

TypeName is any of the above types. Array of these types<br />

TypeName is any of the above types. Pointer to a type<br />

96-bit unsigned binary integer scaled by a variable power of 10. A decimal data<br />

type that provides a size and scale for a number (as in coordinates)<br />

COMPONENT CATEGORY<br />

Component categories are used by client applications to find all COM classes of a<br />

particular type that are installed on the system efficiently. For example, a client<br />

application may support a data export function in which you can specify the<br />

output format—a component category could be used to find all the data export<br />

classes for the various formats. If component categories are not used, the application<br />

has to instantiate each object and interrogate it to see if it supports the<br />

required functionality, which is not a practical approach. Component categories<br />

support the extensibility of COM by allowing the developer of the client application<br />

to create and work with classes that belong to a particular category. If at a<br />

later date, a new class is added to the category, the client application need not be<br />

changed to take advantage of the new class; it will automatically pick up the new<br />

class the next time the category is read.<br />

ESRI keys in the Windows system registry<br />

COM AND THE REGISTRY<br />

COM makes use of the Windows system registry to store information about the<br />

various parts that compose a COM system. The classes, interfaces, DLLs, EXEs,<br />

type libraries, and so forth, are all given GUIDs that the SCM<br />

uses when referencing these components. To see an example of<br />

this, run regedit, then open HKEY_CLASSES_ROOT. This<br />

opens a list of all the classes registered on the system.<br />

COM makes use of the registry for a number of housekeeping<br />

tasks, but the most important and most easily understood is<br />

the use of the registry when instantiating COM objects into<br />

memory. In the simplest case, that of an in-process server, the<br />

steps are as follows:<br />

1. Client requests the services of a COM object.<br />

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