Using COM Events in Managed Code

One of the most complicated aspects of using COM Interop is its support for connection point events. The Type Library Importer generates a rather complex Interop assembly if your COM server uses connection points. The reason for this complex Interop assembly is the rather convoluted mapping that occurs between delegate-based events in the managed world and connection point events in the COM world. I'm going to assume that you already know about connection points (if you don't, see Chapter 8 of my book, The COM and COM+ Programming Primer), but, before I get started on handling COM events using Interop, let's talk about .NET delegates and events.

In some cases, the typical client/server model where a server component ...

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.