Developers Workshop to COM and ATL 3.0

 < Free Open Study > 


Up until this point in your COM journey, you have been writing every line of source code from scratch. Chapters 3, 4, and 5 were devoted to illustrating what can be done with "raw COM" using C++ and IDL. I hope you have found that although COM can be a bit much to swallow in one session, it can eventually be digested into fairly clear pieces. However, I would also imagine you noticed the following points about implementing COM servers "in the raw":

In short, COM requires lots of boilerplate code. These days, no sane developer would begin a new COM project from scratch-unless you need to learn the basic building blocks of COM. After that point, you really should adopt a component framework to help you with the repeat code demanded by COM.

The Active Template Library (ATL) supplies the help you have been longing for. This collection of C++ templates, macros, and classes is aimed at helping you develop very small and very fast COM servers. ATL contains code to assist you when developing traditional COM objects, ActiveX controls, Automation servers, MTS components, and MMC Snap Ins as well as full-blown Windows executables. As an added bonus, ATL 3.0 has extended the number of CASE tools, giving you just about as much flexibility and support as MFC developers have grown accustomed to.

Much like MFC, ATL projects begin by accessing CASE tools to provide a minimal and complete code base for the project at hand. The ATL COM AppWizard is used to create the component housing for your COM server and is typically followed by using the ATL Object Wizard to insert any number of coclasses into their new home.

Unlike MFC, ATL has much slimmer support for Windows application development. This does not imply you could not use ATL to build the next version of Microsoft Word or a high-profile graphics application. What this does imply is that ATL does not offer you the full set of wizards, data structures, and helper classes found in a Windows application framework such as MFC.

For example, there is no Dialog Data Exchange (DDX) support in ATL. You do not have utility classes (such as CPoint, CRect, CPen, and so forth) wrapping Windows drawing primitives. ATL is a component framework aimed at helping you build robust COM servers. To this end, if you are a C++ developer, ATL is the absolute best choice around. Specifically, ATL is here to help you with the following aspects of your COM server development (among others):

I'm sure this partial list has you sold already, so let's begin to get our hands around the Active Template Library.


 < Free Open Study > 

Категории