[Mono-list] interop question

Dietmar Maurer dietmar@ximian.com
25 Oct 2001 08:46:18 +0200


On Wed, 2001-10-24 at 23:03, Lloyd Dupont wrote:
> i try to call C code passing C# char[] type to C short * type.
> 
> unfortunately the following line
> [DllImport("struct.dll")]
> public static extern void printCharArray(int n, 
> [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I2)] char[] s);
> 
> convert my char[] to a char *
> any solution ?

[DllImport("struct.dll"),  CharSet=CharSetUnicode]

Maybe that helps?

  Dietmar