[Mono-devel-list] Interoperatbility between Unmanaged and Managed Programs

Paolo Molaro lupus at ximian.com
Fri Mar 12 10:14:34 EST 2004


On 03/10/04 Friedrich Priewasser wrote:
> For my thesis I have to implement a runtime mechanism that allows managed 
> programs to use unmanaged objects and vice versa. If I'm rigth the best 
> way to do this is to implement COM, XPCOM or ORBit.
> My questions about that are:
> Which of these technologies is the best to solve my problem (if you think 
> I should use one of this)?
> Has there be done any work in mono to use unmanaged objects?

I described the process in a mail to the list some time ago, you may
want to google for it. Basically, apart from the other options mentioned
already, the runtime support would involve (for COM, XPCOM and the
like):
*) a tool to export COM/XPCOM/etc interfaces to a managed assembly
(using the import flag for types and methods).
*) an interface in the C runtime to enable the loading of C modules
which implement the support for one of COM, XPCOM, etc. The
implementation should go into a loadable module to avoid bloating the
runtime and keeping a clean design for the different object technologies.
The interface would allow for detection (which module implements a given
type/interface), creation of objects and creation of the marshaling
methods from managed to unmanaged world (in a similar way it's done for
P/Invoke methods now in metadata/marshal.c).
*) changes to the jit so that when a method with the import flag needs
to be compiled, control is transfered to the modules that handles the
type (typically identified by a GUID): the module will create the IL
code on the fly and the jit will compile that.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list