Re: Calling D DLL from C# and passing/retrieving string variables

2011-10-13 Thread Andre
Am Wed, 12 Oct 2011 21:49:14 +0200 schrieb casual.ja...@yahoo.es: -SetLastError = false, CharSet = CharSet.Auto)] +SetLastError = false, CharSet = CharSet.Ansi)] CharSet.Auto will choose UTF-16 unless you add use the Windows ANSI method convention (i.e. name your

Calling D DLL from C# and passing/retrieving string variables

2011-10-12 Thread Andre
Hi, I try to write a DLL in D which could be called from C#. For testing I want to write a Concatenate method. The call to the DLL method does not raise any exception in C# but the out string strResult is empty or it contains invalid characters. I tested it with strcopy, toStringz, string.ptr and

Re: Calling D DLL from C# and passing/retrieving string variables

2011-10-12 Thread Trass3r
[DllImport(mydll.dll, CallingConvention = CallingConvention.Cdecl, SetLastError = false, CharSet = CharSet.Auto)] private static extern bool concatenate( string str1, // in string str2, // in StringBuilder

Re: Calling D DLL from C# and passing/retrieving string variables

2011-10-12 Thread Regan Heath
On Wed, 12 Oct 2011 17:10:09 +0100, Trass3r u...@known.com wrote: [DllImport(mydll.dll, CallingConvention = CallingConvention.Cdecl, SetLastError = false, CharSet = CharSet.Auto)] private static extern bool concatenate( string str1, //

Re: Calling D DLL from C# and passing/retrieving string variables

2011-10-12 Thread casual . james
On Wed, 12 Oct 2011 18:00:10 +0200, Andre an...@s-e-a-p.de wrote: Hi, I try to write a DLL in D which could be called from C#. For testing I want to write a Concatenate method. The call to the DLL method does not raise any exception in C# but the out string strResult is empty or it contains