Programming with Microsoft Visual C++.NET 6ed [Electronic resources]

George Shepherd, David Kruglinski

نسخه متنی -صفحه : 319/ 221
نمايش فراداده

An ATL Roadmap

If you look at the source code for ATL, you'll find that ATL consists of a collection of header files and C++ source code files. Most of it resides inside the ATLMFC\Include directory that comes with the installation of Microsoft Visual Studio .NET. Here's a rundown on some of the ATL files and what's inside each of them.

AtlBase.h

This file contains:

  • ATL's function typedefs

  • Structure and macro definitions

  • Smart pointers for managing COM interface pointers

  • Thread synchronization support classes

  • Definitions for CComBSTR, CComVariant, threading, and apartment support

AtlCom.h

This file contains:

  • Template classes for class object/class factory support

  • IUnknown implementations

  • Support for tear-off interfaces

  • Type information management and support

  • ATL's IDispatch implementation

  • COM enumerator templates

  • Connection point support

AtlConv.cpp and AtlConv.h

These two source code files include support for Unicode conversions.

AtlCtl.cpp and AtlCtl.h

These two files contain:

  • The source code for ATL's IDispatch client support and event firing support

  • CComControlBase

  • The OLE embedding protocol support for controls

  • Property page support

AtlIFace.idl and AtlIFace.h

AtlIFace.idl (which generates AtlIFace.h) includes an ATL-specific interface named IRegistrar.

AtlImpl.cpp

AtlImpl.cpp implements such classes as CComBSTR, which is declared in AtlBase.h.

AtlWin.cpp and AtlWin.h

These files provide windowing and user-interface support, including:

  • A message-mapping mechanism

  • A windowing class

  • Dialog support

StatReg.cpp and StatReg.h

ATL features a COM component named the Registrar that handles putting appropriate entries into the Registry. The code for implementing this feature is in StatReg.h and StatReg.cpp.

Let's start our excursion into ATL by examining ATL's support for client-side COM development.