Updates
Latest Tweet
What's New?
Check out for latest innovation, a computer based training video collection
Like this Page
COM and .NET Interoperability Review by Jeffrey Heaton
From COM to .NET and Back Again
There may be times when you need to access legacy COM DLL's written in non-managed C++ or Visual Basic. This may be as a stop-gap measure until your older legacy code can be updated to .NET. In cases where performance is critical, you may have no desire to ever upgrade your C++ DLL, but would like to use C# for GUI design, rather than Microsoft Foundation Classes. If any of these situations apply, this is the book for you.
This book begins with a few chapters that will bring the reader up to date on both sides of the GAP. First you are shown the fundamentals of COM objects. Second you are shown the newer .NET architecture. Only by understanding both sides will you be able to make the two effectively communicate. For experienced users, who are already familiar with COM and .NET this section can easily be skipped. The book then continues with an overview of what datatypes are available on each side, and how they cross over.
The real meat of the book comes in the next two sections. Three chapters (the basics, intermediate and advanced topics) are given first for COM to .NET. Then the exact same pattern is repeated from .NET to COM. I spent most of my time with the .NET to COM part of the book, as I was using a C++ DLL with C#. The book answered all of my questions and I was able to successfully implement the application.
The book provides a great deal of good information, but it is sometimes hard to find exactly what you are looking for. Each direction is covered in chapters named the basics, intermediate and advanced topics. What exactly is meant by this is not clear until you begin the chapter. I often found myself skimming all three sections trying to find an example close to what I was doing.