Book Reviews

Subscribe to Book Reviews: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Book Reviews: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Book Reviews Authors: Kenrick Freemen, Tad Anderson, Sharon Drew Morgen, Holocaust Research Project, Stewart McKie

Related Topics: Book Reviews

Book Reviews: Article

Book Reviews

Ascending technology bluffs in the world of COM

.NET and COM - The Complete Interoperability Guide is divided into four major areas: using COM components in .NET, using .NET components from COM, designing great COM components for .NET, and designing great .NET components for COM. A brief scan of the table of contents will quickly convey the wealth of material that has been compiled into this book. Adam Nathan starts out with an overview of .NET, managed code, and unmanaged code. In the first two chapters, he provided the reader with the necessary vocabulary that is applied throughout the book. His description of advanced .NET topics such as assemblies, metadata, and Intermediate Language (or IL) will benefit the .NET programmer who has little interest in working with COM components. The audience for his book extends beyond developers faced with building the next generation of hybrid .NET and COM applications.

In fact, this book covers so much material that you'll probably only focus on a particular subset of topics within the 24 chapters. For example, Adam takes you well beyond the Visual Studio .NET interface that invokes the built-in type library importer utility (TLBEXP.EXE), and gives you a nearly exhaustive overview of the aspects involved with Runtime Callable Wrappers (RCWs), which provide the necessary marshalling and other facilities for utilizing unmanaged COM components from a managed .NET application. If you aspire to be a .NET assembly language programmer with the skill to craft raw IL code and feed it directly to the CLR, then you'll be especially interested in the chapters on modifying Interop assemblies, custom marshalling, and PInvoke.

You don't have to be working with your legacy COM or COM+ technology to find this book useful. If you only want to learn more about IL or PInvoke, then you'll certainly appreciate having a copy of this book within arms' reach.

The main point with which I would like to leave you is that there's something for everyone. The organization of the book is consistent and symmetrical between the topics of .NET and COM components, the style of writing makes for an easy and enjoyable read, and all of the examples are provided in both Visual Basic .NET and C# and are available for download. I can confidently say that all .NET developers would benefit from having such a resource close at hand.

ATL Internals provides a solid introduction into the ActiveX Template Library (ATL). Following the growth of OLE and ActiveX, ATL was promoted by Microsoft as a technology in which to construct ActiveX controls as well as other types of COM entities such as ActiveX controls or COM Servers. For the most part, Microsoft has been successful in convincing mainstream C++ developers to use ATL when building COM or COM+ components.

This book complements the .NET and COM book by providing detailed backgrounds on both COM and ATL. The authors touch on many topics involving COM. Drawing from my experiences with COM Interop, I've spent most of my time in four key chapters: An Introduction to ATL, ATL Smart Types, Collections and Enumerations, and ActiveX Controls. The first chapter takes you through the basics of constructing an ATL class within Visual Studio using the built-in wizard. The second key chapter focuses on ATL Smart Types and covers key ATL entities such as BSTRs and VARIANTS along with their ATL SmartTypes equivalents. These are critical data types, especially in areas such as COM Marshalling, which is frequently used in production code. The chapter on Collections and Enumerations provides you with a detailed overview of how to expose STL-based data structures using COM Collections in ATL. Finally, the chapter on ActiveX controls discusses the interfaces required for ActiveX, along with how to go about building a control in ATL.

This book predates the emergence of .NET, so you won't find a description of .NET, but instead a solid, in-depth introduction to ATL. The ideal reader of this book will have a good foundation in C++ and possibly only a cursory understanding of ActiveX and/or COM. With such a background, this book will do an excellent job of bridging the gap between COM and .NET.

Chapter 7 of ATL Internals on Collections and Enumerations was the most interesting chapter for me. This topic seemed to help pave the way for following Microsoft's advice on revising existing COM interfaces to using strongly typed interfaces when bringing these components forth in the .NET world. Chapter 7 is devoted to the technical nuances of the interface composition, array enumeration, iterating Standard Library data structures, and tying the various pieces together to build a COM enumeration interface. ATL Internals will be particularly helpful if you've had some exposure to OLE, ActiveX, or COM but haven't done much ATL programming.

If you find yourself maintaining and advancing a legacy architecture comprised of COM components, and you've made a commitment to .NET, then I suggest picking up a copy of both books.

More Stories By Kevin Wittmer

Kevin Wittmer works for SmartSignal Corporation as a technical lead. His programming interests span .NET, Java, C++, and Perl.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.