Passing string from C++ to C#
I am using the PInvoke, reverse PInvoke scheme as described by Thottam R. Sriram http://blogs.msdn.com/b/thottams/archive/2007/06/02/pinvoke-reverse-pinvoke-and-stdcall-cdecl.aspx Everything seems to work well, except for passing a string from C++ to C. ( In Sriram the string is constructed in c# and passed untouched through c++, so the issue is avoided. ) The c# code looks like this class Program { public delegate void callback(string str); public static void callee(string str) { System.Console.WriteLine("Managed: " + str); } static void Main(string[] args) { gpscom_start(new callback(Program