Object Life-Cycle Implications

When you are using a managed code object from a COM/Win32 client, you face a mismatch between the life-cycle scheme that the client uses and expects and the life cycle that the underlying object uses. As you already learned in Chapter 6, the CCW exposes a managed object to unmanaged consumers so that it appears for all intents and purposes to be like any other COM object. The CCW synthesizes an implementation of system-level interfaces like IUnknown, IDispatch, and ISupportsErrorInfo. The CCW exposes COM equivalents of any managed interfaces that the managed class supports, and it may also expose a class interface that exposes all of the public methods implemented by the class. All of these interfaces exposed by ...

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.