[Mono-list] Call managed from unmanaged code?

Jonathan Chambers joncham at gmail.com
Wed Aug 18 22:07:25 EDT 2010


Hello Kurt,
     You can achieve this in a few ways.

1. The easiest and most portable is to marshal a delegate into a function
pointer, and then pass that pointer into native code to call back onto.

2. If you are using the embedding API, you can register internal calls with
the runtime that you can call from C#.

http://www.mono-project.com/Embedding_Mono#Exposing_C_code_to_the_CIL_universe

<http://www.mono-project.com/Embedding_Mono#Exposing_C_code_to_the_CIL_universe>3.
Mono does have some support for COM Interop, but note that there is minimal
to no tool support for generating the wrapper interfaces and interop
libraries.

http://www.mono-project.com/COM_Interop

<http://www.mono-project.com/COM_Interop>Thanks,
Jonathan

On Wed, Aug 18, 2010 at 9:27 PM, <Krogerma at aol.com> wrote:

>  Hello, List:
>
> Is it possible to call into a managed DLL from an unmanaged C/C++
> application with the facilities within Mono? We would like to do this on the
> Mac at the moment, but we would need to do it from Suse Linux also.
>
> We are currently calling unmanaged DLL's from managed ones in our project
> and someone asked me whether we could call managed from unmanaged. Does Mono
> support something like COM-to-Net wrappers? I couldn't find a good reference
> for this in the archives.
>
> Regards;
>
> Kurt Matis
> troy, NY.
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20100818/4c522d78/attachment-0001.html 


More information about the Mono-list mailing list