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 ...

Get Delphi for .NET Developer’s Guide now with O’Reilly online learning.

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