The second part of this book switches away from interoperability issues and focuses instead on creating and using COM components by exploiting the new features of Visual C++ .NET. The Active Template Library (ATL) was introduced in Visual C++ 4, and was designed to let C++ programmers create the smallest, fastest , most efficient COM components possible. The library has matured with successive releases of Visual C++ and now provides a very powerful tool for the C++ COM programmer.
Microsoft has introduced many new features into the latest version of ATL, version 7. Most important, though, Microsoft has introduced a new way to write ATL COM components, using attributed programming . This innovation makes it possible to write ATL COM components directly in C++, and for many components, developers will no longer have to interact with the Interface Definition Language (IDL) or work with the ATL source code. In fact, the compiler generates the IDL and ATL source code at compile time, so you dont need to look at them at all unless you want to understand what is happening.
This chapter provides an introduction to attributed programming, while Chapter 7 looks at the additions to the latest version of ATLin particular, the ATL Server classes, which are designed for writing server-side applications for use with Internet Information Server (IIS).
Attributed programming is used to create COM components in C++ using the ATL library. That means this chapter has nothing to do with .NET and also assumes knowledge of C++ and ATL programming on the part of the reader. No information in this chapter applies to Visual C# or Visual Basic .NET.