Closed
Description
I am sorry about all the questions. I do not know well if you search on Google, so please let me know.
Can I pass an array from JNA to .net using UnmanagedExports?
Here is my code
//java
int arr = new int[2];
arr[0] = 1;
arr[1] = 2;
test(arr);
//JNA
public interface VbWrapper extends Library {
public int test(int[] intArr);
}
//.net
<DllExport("test", CallingConvention.StdCall)>
Function test(ByVal arr() As Integer) As Integer
MsgBox(arr.length) ' printed 1
MsgBox(arr(1)) ' invalid memory access
Am I making a mistake?