Using COM Objects from .NET Clients

Using COM objects from .NET clients is sure to be the most widely used COM Interop scenario. In this section, I discuss the infrastructure and tools that the .NET Framework provides to make it easy for you to use COM object from within managed code clients. The two important pieces are the RCW that sits between the managed code client and the COM object and performs all the magic required to make the COM object appear to be just another managed code object and the Type Library Importer (tlbimp.exe) that allows you to generate .NET metadata from a COM type library. I'll conclude this section by building a simple example application that uses a COM object through Interop.

RCW

The CLR automatically creates a RCW ...

Get .NET and COM Interoperability Handbook, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.