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 />

The function DllGetClassObject is the function<br />

that makes a DLL a COM DLL. Other functions,<br />

such as DllRegisterServer and<br />

DllUnregisterServer, are nice to have but not<br />

essential for a DLL to function as a COM DLL.<br />

2. SCM looks for the requested objects registry entry by searching on the class ID<br />

(a GUID).<br />

3. DLL is located and loaded into memory. The SCM calls a function within the<br />

DLL called DllGetClassObject, passing the desired class as the first argument.<br />

4. The class object normally implements the interface IClassFactory. The SCM<br />

calls the method CreateInstance on this interface to instantiate the appropriate<br />

object into memory.<br />

5. Finally, the SCM asks the newly created object for the interface that the client<br />

requested and passes that interface back to the client. At this stage, the SCM<br />

drops out of the equation, and the client and object communicate directly.<br />

From the above sequence of steps, it is easy to imagine how changes in the<br />

object’s packaging (DLL versus EXE) make little difference to the client of the<br />

object. COM handles these differences.<br />

AUTOMATION<br />

Automation is the technology used by individual objects or entire applications to<br />

provide access to their encapsulated functionality via a late-bound language.<br />

Commonly, automation is thought of as writing macros, where these macros can<br />

access many applications for a task to be done. ArcObjects, as already stated, does<br />

not support the IDispatch interface; hence, it cannot be used alone by an automation<br />

controller.<br />

Chapter 4 • <strong>Developer</strong> environments • 69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!