[Mono-devel-list] COM Interop

Paolo Molaro lupus at ximian.com
Wed Jul 27 07:42:09 EDT 2005


On 07/25/05 Jonathan S. Chambers wrote:
> 	Thanks for the response Rafael. I have a large amount of C++/COM
> code and migrating it all is not an option (due to shear size and
> performance reasons). I can port this code to *nix but have no way to
> call it.

Just make sure that all the code you have can be recompiled on *nix and
that it doesn't depend on any other binary component.

> 	And just an FYI, I don't want all the COM/COM Interop
> functionality. I wanted the runtime to be able to call into the vtable I
> define through a corresponding managed interface, and the ability to
> handle casting by calling QI (if trying to cast an unmanaged component
> to a different interface, a cast can succeed if the QI succeeds even if
> the managed wrapper does not inherit from that interface). Any insight
> on this would be appreciated.

I wrote a post to the list a few months or years ago with ideas on the
implementation. Mono already supports some of the things you need
to implement remoting (like, call a method when an interface cast fails).
Calling a C++ vtable method is just a matter of generating the proper IL
code (at runtime or compile-time) to use the calli IL instruction.
Implementing the support is doable, just make sure that you can
effectively port or implement all the code C/C++ you need (ie also the 
com runtime parts).

lupus

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



More information about the Mono-devel-list mailing list