As for the textbooks :
I did not find really good online. There are several OK pages when using ATL / COM:
- An active template library makes Building Compact COM Objects a Joy of Don Box (COM Veteran Guru). This article begins: “I love COM. COM is good. As a great Pilsner or El, COM will never disappoint. In fact, the more I look at COM, the more I like it. Unfortunately, I work in C ++, and C ++ does not share my appreciation for the finer things in life. " Despite the great master of proselytism and the fact that it's 12 years old, this is a pretty good article ...
- Mike Dunn is a great tutorial on COM in CodeProject.
- Tips DevGuy C ++ COM - a kind of hash of links and suggestions.
- "A book for COM programmers" - this ancient article (1995) is not bad, despite its age and the fact that it describes the implementation of COM objects in C, not C ++ (explicit vtables!)
I am a bit rusty myself with COM and ATL, but if I remember correctly, the classes you want to find out what you will use the most (especially if you use someone else's COM objects, rather than implementing your own) are CComBSTR, CComPtr and CComVariant. In addition, the #import operator in Visual C ++ simplifies the use of external COM objects; it generates a class of smart pointers for you from an external DLL or EXE.
If you intend to implement COM objects, I highly recommend getting a copy of ATL Internals (there is a newer version now covering ATL v8). Yes, it does go into some details in sections, but even as an introductory book it is well written.
If you've never used COM before, the “classic” Essential COM and Effective COM books are very good, and you can probably get them inexpensively from your favorite sources of used books. You will also want to be familiar with the RAII idiom if you have not already done so.
The microsoft.public.vc.atl newsgroup is very helpful for asking specific questions. (they are generally rougher than on StackOverflow, though)
Beware: there are many small bugs with COM, although ATL helps it become much easier and without much bloat. The aka CRTP "simulated dynamic binding" methods are useful in the C ++ world, not only in the context of ATL / COM, but especially if you are creating a library of reuse classes that you want to subclass or mix in situations where only one instance is present (for example, the CSpiffyFramework class, which provides mixing functions that you want to reuse a lot, and you have a derived class that you want to enable this functionality, and it is not part of the virtual object library delhi, so you really don't need a virtual table).
Good luck
Jason s
source share