My client gave me dll with a couple of functions. One of them is:
int GetVersions(char* name, char** &pVersions);
It returns a number of versions for the given name and the array of strings with those versions. Using JNA, I'm trying to write equivalent Java method in my interface:
int GetVersions(String name, String ll, ??? pVersions);
The problem is what type should be instead of ???
?
I was trying to put there PointerByReference
and after method invocation I had:
Pointer ptr = ptrRef.getValue();
String ppp = ptr.getStringarray(0);
but I got here Invalid memory access
.
Pointer ptr = ptrRef.getValue();
String ppp = ptr.getString(0, "UTF-8");
returns garbage.
Any idea how to solve it?
Thanks in advance!