Description
I want to call vb.net ByRef and String function from java.
vb.net dll is maked by UnmanagedExports.
//java
String[] str = {"testJavaWrited"};
String[] str2 = {"testJavaWrited2"};
final VbWrapper wr = (VbWrapper)Native.loadLibrary("vbtestlib", VbWrapper.class);
wr.test(str,str2);
System.out.println(str); // not printed
System.out.println(str2); // not printed
// jna mapping
public interface VbWrapper extends Library {
public int test(String[] str,String[] str2);
}
//vb.net
<DllExport("test", CallingConvention.StdCall)>
Function test(ByRef str As String, ByRef str2 As String) As Integer
MsgBox("test Called") ' printed
MsgBox(str) ' printed
str = "testStringWrited"
str2 = "testStringWrited2"
Return 0
End Function ' heap error
I need your help everybody.
http://stackoverflow.com/questions/41830352/how-to-call-jna-to-vb-net-byref-string-function