I trying to write a software in C# that make calls in a .dll wrote in Delphi.
Im trying to call this method (wrote in delphi):
Function Recebe_Cartao (var Matriz : array [ 1..721 ] of char) : boolean
In my C# code, I declare like this:
[DllImport("[url removed, login to view]", CharSet = [url removed, login to view])]
public static extern bool Recebe_Cartao( char data);
The problem is when I call in C# this method in my console application:
I get an error: Cannot marshal 'parameter #1': There is no marshaling support for nested arrays.
I found a solution in: [url removed, login to view] but I still dont know how to fix my code.
You can download my project in: [url removed, login to view]
Main objective: I need loop through all values of RetornoMatriz array.
I changed my project in www.csharp.com.br/leitora.zip
Now I declare:
[DllImport("lc3000.dll", CharSet = CharSet.Unicode)]
public static extern bool Recebe_Cartao( out char data);
I get this error:
he runtime has encountered a fatal error. The address of the error was at 0x6390a520, on thread 0x1c2c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.