[Mono-dev] Interop question, C++ string marshaling

Gennadiy Donchyts don at env.com.ua
Wed Nov 23 19:20:27 EST 2005

Hi all,

is there standard way of C++ string marshaling. I'm trying to write
wrapper of the C++ library in C#. And what is the best recommended
way to do such wrapping in Mono if I have library in C++?

Is it better to export everything as the C structures + functions with
extern "C" __declspec(dllexport) or classes are also supported quite well?
(the final code should be clean and easy readable and portable of course).

What is Is it better to use StdCall or Cdecl? I started with Cdecl but later

did not manage to make callback work wit Cdecl here:

typedef void (__stdcall *LogHandler) (const char *message);
static LogHandler log_handler = 0;

I plan to make all interface C++ / C# code to be generatable, could you
point me for some some good recommented examples of using SWIG or
similar library for such C# <=> C++ interops which are implemented?

Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051124/672a1e5d/attachment.html 

More information about the Mono-devel-list mailing list