Using .NET Objects in COM Code
Having looked at .NET code that uses COM objects, let’s now turn the tables and look at Win32 client applications using .NET objects as if they were COM objects. As you develop code in .NET, you might want to make use of it in existing COM client applications, and .NET supports this. With sufficient information in the registry, a COM client can request that an object be created by COM, and it will end up with a COM object being instantiated that represents your .NET object. The COM object will do the tricky stuff of marshaling parameter data back and forth across the managed/unmanaged boundary and reconciling the reference counted lifetime management of .NET with the garbage collected scheme in .NET. Because the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access