I am trying to create an array of my class (which extends the JNA structure) to pass it to a DLL function. I have values ββthat are read from a database in an ArrayList, and now I need to put them in an array. First, I tried using the ArrayL (ArrayList) method, but it returns me the following exception when I call the native function:
java.lang.IllegalArgumentException: Structure array elements must use contiguous memory (bad backing address at Structure array index 1)
If I just set up a new array with the same size as ArrayList, when I set the βfieldsβ of the structure in my class, it will return a NullPointerException to me.
Can anyone help me solve this problem?
source share