[Mono-list] Questions on the Mono roadmap
William S Fulton
wsf@fultondesigns.co.uk
Thu, 20 Jan 2005 11:29:06 +0000
Paolo Molaro wrote:
> If you need to access managed code from C++ using mono, the
> embedding interface is the right way to do it, wrappers like
> cilc can help to provide a nicer interface.
> If you need to access C++ code from mono you currently
> need to provide C wrappers that can be pinvoked: it's not
> unlikely, though, that an enterprising contributor or a
> skilled student would enhance mono so that it can use C++
> directly with a simple attribute set on a class (maybe
> also generating the class automatically by parsing the C++
> header files).
>
Take a look at SWIG http://www.swig.org. It parses existing C++ header
files and generates C# proxy classes to access the unmanaged code from
any .net language via C/PInvoke calls. The resulting code can be
compiled by any of the C# compilers and is cross-platform, so isn't tied
to just the MS or mono tools/environment.
William