Chapter Thirty

ATL and ActiveX Controls

If you've finished reading about COM and ATL and still wonder how COM fits into your day-to-day programming activities, you're not alone. Figuring out how to use COM in real life isn't always obvious at first glance. After all, a whole lot of extra code must be typed in just to get a COM object up and running. However, there's a very real application of COM right under your nose —ActiveX Controls. ActiveX controls are small gadgets (usually UI-oriented) written around the Component Object Model.

In Chapter 29, you examined COM classes created by using ATL. In this chapter, you'll learn how to write a certain kind of COM class—an ActiveX control. You had a chance to work with ActiveX Controls from the client side in Chapter 8. Now it's time to write your own.

There are several steps involved in creating an ActiveX control using ATL, including:

This chapter covers all these steps. Soon you'll be able to use ATL to create ActiveX controls that you (or other developers) can use within other programs.