.NET COM Support

For Managed code to consume the services provided by a COM component, a bit of translation must take place. After all, you won't find CoInitialize or CoCreateInstance within the .NET framework. Such arcane practices, which most of us spent considerable time learning, are no more. Instead, the .NET environment introduces the notion of a Runtime Callable Wrapper or RCW. From the viewpoint of the Managed client there is no real difference between using the RCW and a managed component. Figure 5.3.1 depicts a very generic view of a Managed client using a RCW to interact with a classic COM component.

Figure 5.3.1. Generalized view of RCW.

An RCW has several responsibilities that shield the developer from tasks such as reference counting, ...

Get C# and the .NET Framework: The C++ Perspective now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.