Click here to Skip to main content
15,124,736 members
Articles / Programming Languages / Visual Basic
Posted 24 May 2003


23 bookmarked

.NET and COM: The Complete Interoperability Guide

Rate me:
Please Sign up or sign in to vote.
2.92/5 (12 votes)
24 May 20034 min read
Book Review of .NET and COM: The Complete Interoperability Guide

This article is in the Book Review chapter. Reviews are intended to provide you with information on books - both paid and free - that others consider useful and of value to developers. Read a good programming book? Write a review!

.grade {font-size:7pt}
Title.NET and COM: The Complete Interoperability Guide
AuthorAdam Nathan
PublisherSams Publishing
PublishedJanuary 2002
PriceUSD 59.99

The .NET Framework SDK and Visual Studio .NET make it easy to use legacy COM components from .NET-based code (also referred to as managed code). The Framework does a lot of work for you by abstracting the differences between the unmanaged world of COM and the managed world of .NET through interception. Interception occurs in a piece of code referred to as the Runtime-Callable Wrapper (RCW) whose role is to seamlessly integrate the .NET and COM worlds so that they can peacefully coexist. For example, COM components report an error using a special return value that is an HRESULT data type. Your managed (.NET-based) application errors to be reported as exceptions and is unaware of the HRESULT data type. The RCW converts failure-related HRESULTs codes (codes other than the S_OK success code and user-defined HRESULTs) into equivalent .NET exceptions providing a programming model that's consistent with the rest of the .NET programming environment. When a COM component returns a user-defined HRESULT, the RCW maps it into a System.Runtime.InteropServices.COMException and stores the HRESULT value in the exception's ErrorCode property - again providing .NET applications with a consistent programming model that makes it easy to detect and respond to error conditions.

That's only a very small part of the .NET and COM interoperability story - this book covers the rest of it in great detail in an engaging way that brings some kick to a perhaps seemingly boring topic. Among the engaging aspects of this book are the "Digging Deeper", "Tip", and other notes that sprinkled throughout which provide valuable insights to the discussion at hand.

.NET and COM weighs in at 1578 pages with about 1245 pages of content, 250 pages of appendices, and 81 pages taking up the comprehensive index (all page counts are approximate since the book includes separator pages between sections and chapters). The book's content is packed with practical information in the form of guidance and detailed information right from the first page. However, the sheer density of the information makes it easy to miss important points such as the author's recommendations on how to version .NET components (assemblies) to make it easy for COM-based clients to use them in the unmanaged world.

The book is divided into nine sections:

  • Background
  • Using COM Components in .NET Applications
  • Using .NET components in COM Applications
  • Designing Great .NET Components for COM Clients
  • Designing Great COM Components for .NET Clients
  • Platform Invocation Services
  • Advanced Topics
  • Comprehensive Examples
  • Appendices

Each section builds on it predecessors' but not all readers may agree with the organization. I personally would have preferred the Designing sections to appear before the Using sections since good design is essential to easy use. Although most readers will likely read the book in the order it's presented in, the book is organized to make it easy to hop around from section to section of interest without getting lost.

Although this is a great book, there are a couple of drawbacks:

Serviced components, also known as COM+ components, are given less than 10 pages of coverage throughout the book. Granted that COM+ sounds like it provides services only to COM components, it does play an important role in the managed world of .NET applications. In fact, COM+ is so important to .NET that there are an entire set of classes and attributes available in a dedicated namespace called System.EnterpriseServices. COM+ provides services that extend .NET applications' abilities over those provided by basic .NET.

The second drawback relates to how some important information gets disbursed throughout the entire book rather than just one place. For example, when you create a .NET component that will be used by COM clients, you have the option of using one of three attributes to expose the .NET component's interface to COM. The fist time this feature is mentioned is in chapter three on page 397 where, if you read to the end of the "FAQ" box, you'll see a reference to chapter 12 where more information on the topic appears on page 556. What's interesting is that one of the most critical points appears in one of two "Caution" notes making it difficult to see that there's something really important on the page. In addition, some more information appears, along with some of the text from chapter 12, much later in appendix A (on page 1257) with a reference back to chapter 12. All of these references and presentation styles work to dilute the importance of the information and effectively hide it from novice readers (those that are new to .NET, COM, or both).

Despite these few drawbacks, this is a great book for intermediate .NET developers that have some experience with COM can benefit from. The book's scope makes this book useful for developers that work on both COM-centric and .NET-centric environments.


Overall Value5

Calculate the Grade as follows: Add all numeric grade values, divide by 25, multiply by 100, then assign the letter grade based on the following ranges:

A+:100A :95A-:90B+:85B:75B-:70C+:65C :60C-:50D+:40D :30D-:25F :0


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Erik Westermann
Software Developer (Senior)
Canada Canada
Erik is a senior developer-writer with more than 20 years professional programming experience designing and developing large scale database and Internet-centric applications for organizations including, ADP, Nortel, EDS, Merrill Lynch, ePost, CIBC, TD Securities, IBC, CIHI, InnovaPost, etc.

Erik has been specializing in BizTalk Server-based solutions for many years. His experience includes many SOA and ESB-style applications using technologies like Commerce Server, SharePoint, ASP.NET and advanced .NET Framework.

Comments and Discussions

QuestionMessage Closed Pin
9-Mar-12 21:55
Membersangram3609-Mar-12 21:55 
QuestionStarting COM programming Pin
TheEagle17-May-06 4:51
MemberTheEagle17-May-06 4:51 
GeneralPages Pin
Maximilian Hänel26-May-03 5:05
MemberMaximilian Hänel26-May-03 5:05 
GeneralRe: Pages Pin
Erik Westermann26-May-03 17:23
professionalErik Westermann26-May-03 17:23 
GeneralRe: Pages Pin
Maximilian Hänel27-May-03 13:58
MemberMaximilian Hänel27-May-03 13:58 
Hi Erik!

Don't get me wrong. The article is very well and I actually ordered the book (after reading this article). However the total page number is still wrong Poke tongue | ;-P
According to Amazon it's 1608...



"You can always improve your chances of writing
bug-free code by writing code that doesn't do anything"

Rob Macdonald, Serious ADO

GeneralRe: Pages Pin
Erik Westermann28-May-03 0:48
professionalErik Westermann28-May-03 0:48 
GeneralIncorrect Author Pin
Richard Birkby26-May-03 3:06
MemberRichard Birkby26-May-03 3:06 
GeneralRe: Incorrect Author Pin
Roger Alsing26-May-03 3:56
MemberRoger Alsing26-May-03 3:56 
GeneralRe: Incorrect Author Pin
Erik Westermann26-May-03 3:58
professionalErik Westermann26-May-03 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.