[Mono-dev] C++ to C# to C++ interop, how can I do this in a mono-compliant way?

Paul F. Johnson paul at all-the-johnsons.co.uk
Thu Sep 1 04:18:32 EDT 2005


> The C++ engine itself is OS agnostic (it works on windows, linux and
> mac), and I would love to make this C# wrapper work under mono, so
> that it is OS agnostic as well.

Prior to adding the managed C++, it would be platform agnostic. With the
managed stuff in there, not a chance.
> Is there any way to have this work under Mono?   Please realize that
> the basic need is to have 1 instance of a C++ exe call into a .NET
> dll, and have that DLL be able to then execute functions in the C++
> exe that called it.     So this requires a mono-equivlant of PInvoke,
> plus a way to have the C++ app call the C# app. 

Simplest way is to sit on top of the engine and catch the calls in and
out (basically, provide an interface layer). As to getting that to work
I've not a clue.

Calling the other apps from C++ is simple enough. The only caveat is
knowing what platform you're using. If you're on a non-MS platform, find
is mono is there, if it is then just use system("mono cpp.exe). For
Win32, these should have the .NET framework already tacked on, so see if
it does, then system ("cpp.exe") otherwise find mono (as above) or else

I'm not sure how you'd go the other way.


"Logic, my dear Zoe, is merely the ability to be wrong with authority" -
Dr Who

More information about the Mono-devel-list mailing list