Is it possible to pass a string array from managed C# to an unmanaged function using P-Invoke?
This works fine:
[DllImport("LibraryName.dll")]
private static extern void Function_Name(string message);
While this:
[DllImport("LibraryName.dll")]
private static extern void Function_Name(string[] message);
fails with
Unhandled exception: System.NotSupportedException: NotSupportedException
I have tried using MarshalAs with no luck ([MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr)] String[] dataToLoadArr)
Is it possible to pass string arrays this way?