Chapter 3. Components
In the previous chapter, we learned the techniques of defining interfaces. Once we have defined the interfaces, the next step is to create the COM component that implements the defined interfaces. In this chapter we look at various aspects of implementing a COM server. We will use the C++ code that we developed in Chapter 1 and turn it into COM-style C++ code. The focus is on understanding why and how features are implemented in COM, and learning the terminology used in COM-based component development. We will explore several ways to reuse a third-party component s functionality. The primary goal of this chapter is to make you understand the intrinsics of COM-based client and server development. A secondary goal is to make you feel comfortable in developing COM components using Active Template Library (ATL) and developing client code using ATL, as well as using native COM support provided by Visual C++.