In Chapters 25 and 26 you learned that OLE and ActiveX are built on the COM “object model.” The COM object model defines how an object exposes itself and how the exposure works across processes. This chapter will introduce you to another powerful component of the COM family—the ATL. ATL stands for the Active Template Library. The ATL can easily be used to create COM objects, ActiveX controls, and more. The ATL also provides built-in support for many basic COM interfaces.
The ATL provides classes that fit into the following categories:
•
Class Factories
•
Class information
•
COM modules
•
Connection points
•
Controls: general support
•
Data transfer
•
Data types
•
Dual interfaces
•
Error information
•
Interface Pointers
•
IUnknown implementation
•
Object safety
•
Persistence
•
Properties and Property Pages
•
Registry support
•
Running objects
•
Site information
•
Tear-Off interfaces
•
Thread Pooling
•
Threading models and Critical Sections
•
UI support
•
Windows support
You might note that many of these classes were supported and used in Chapters 25 and 26.
In the following sections, we’ll develop a simple ATL application that blends the Microsoft Polygon ATL tutorial application with the functionality of the ActiveX control developed in Chapter 26. However, this ATL application will go a step further. The COM object will be used in a DHTML document that can be viewed in Microsoft’s Internet Explorer!