C# integration with COM component in Delphi
Ngân sách $50-100 USD
Hello,
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:
------------
Recebe_Cartao(RetornoMatriz);
-------------
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.
Thanks
Marcelo
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.
4 freelancer đang chào giá trung bình $63 cho công việc này
Hello, i have 11 years experince in Delphi and C#. Please attach project from Delphi too.
The test program has a lot of communication errors, but I think it was problem with the declaration...