I have a dynamic link library (DLL) written in c++. In my DLL I have a function like this:
void anpr_set_params(byte instance, SLPRParams* params);
Where SLPRParams
is a Structure containing byte, int, float and array of them.
Now, I want to use my DLL in Java. I'm using JNA to call native code in my java project. I tried get help from this site to get the address of my structure in java and pass it to my dll, and I defined my signature function in Java like this:
void anpr_set_params(byte instance, long slpr_params);
But the address i get in c++ is different from the address i sent in Java.
Then I looked for another solution and read the this JNA FAQ entry.
I tested all types but every time I get a runtime error.