Hello,
My CLR class has to get array of C# strings and convert them to 1D array of char pointers passed to a Win32 DLL.
In C# I ran:
private byte[][] convertToBytes(String[] strings) { byte[][] data = new byte[strings.Length][]; for (int i = 0; i < strings.Length; i++) { String s = strings[i]; data[i] = Encoding.ASCII.GetBytes(s); } return data; } String[] strings = new String[]{"first", "second"}; byte[][] byteStrings = convertToBytes(strings); MySafeClass.OpenFile(byteStrings);
What should be the prototype in the CLR code ?
I tried:
int OpenFile (array <System::Byte^>^ byteArray) { // Do something }
But according to the C# compiler:
Argument 1: cannot convert from 'byte[][]' to 'System.ValueType[]'
Can you help ?
Best regards,
Z.V