I am trying to call a C ++ function present in a DLL file, a C ++ function takes a structure object as a parameter by reference, and the function assigns values ββto this function,
So, in my java application, to pass the structure object of the function that I wrote, like this:
interface someinterface extends Library{ public static class strctclass extends Structure { public static class ByReference extends tTIDFUDeviceInfo implements Structure.ByReference {} public short xxx=0; public char yyy='0'; public boolean zzz=false public String www=new String(); protected ArrayList getFieldOrder() {
my main class
public class Someclass { public static void main(String args[]) { someinterface.strctclass.ByReference sss=new someinterface.strctclass.ByReference(); someinterface obj=someinterface.instance; obj.somefunction(sss); } }
when i tried this he gives me
java.lang.ClassCastException: java.util.Arrays$ArrayList cannot be cast to java.lang.Comparable
so what am i doing are there any problems in the getFieldOrder () function?
can someone explain to me exactly how JNA will convert the class object to java to structure the object in C ++?
The actual exception occurs when the function is called, but I do not understand why this is happening.
source share