COM Interop

COM Interop is used in two scenarios: (1) When you want a managed code (.NET) application or component to consume a COM component or (2) when you want an unmanaged (Win32/COM) application or component to consume a .NET component. Both of these scenarios are shown in Figure 6-1.

Figure 6-1. The two COM Interop scenarios.

Scenario 1 will probably be the most widely used initially because most people who start using the .NET Framework will have a large existing code base of unmanaged code that they will want to reuse. However, don't underestimate the importance of scenario 2. Let's say that you have two COM objects, object A and object ...

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.