I introduced COM Interop through the notions of "bridges" in my first article, and I looked at why those bridges, the Runtime Callable Wrapper (RCW) and the COM Callable Wrapper (CCW), were necessary. There are vast differences between the world of COM and the world of .NET, and the bridges help to hide those from the programmer, and they allow interoperation. I also introduced the Type Library Importer tool, Tlbimp.exe, that ships both with the .NET Framework SDK and Visual Studio .NET. In this article, I am going to spend much more time with TLBIMP and show you some of its more advanced uses. I will also introduce you to "siblings" of TLBIMP in the .NET Framework SDK that pertain to COM Interop; Tlbexp.exe, Regasm.exe, and Sn.exe. These tools offer far more flexibility than (COM) Add Reference. ((COM) Add Reference can be considered a very particular subset of TLBIMP, or more properly, System.Runtime.InteropServices.TypeLibConverter.) First, before diving deeper into TLBIMP, we need to take a closer look at .NET metadata.
|