[quote]dont know… but i get the same crash with 32bit winxp.[/quote]If an integer is declared to be 64-bit, it is 64-bit also in the 32-bit system.
You may try changing ‘long’ to ‘int’ and ‘jlong’ to ‘jint’ maybe.
And now? What can i do to solve the problem?
It is possible to compile the K8061.dll without the ReadVersion function?
I don’t think the existence of that function in that dll is your problem.
A few notes about that JNI code. It looks unprofessional to me. It does a GetProcAddress() call for each and every single wrapper call. It should instead use static global function variables, do the function lookup the first time it is needed and then reuse that function pointer on subsequent calls to that same wrapper. Reset all function pointers to NULL when the library is freed.
A more critical mistake however is that only the commented out printf-debug code is ever checking if GetProcAddress() actually returned a valid pointer. It blindly dereferences whatever it got back, which could as well be a NULL pointer.
A jlong is indeed, as VEL255 suspected, a 64 bit value. In C the size of a long value depends on the machine architecture. You are better off including stdint.h and then using int32_t instead. That guarantees the K8061.dll function prototypes use the correct data types.
I replaced the long/jlong to int/jint but without success.
Finaly i found an other way:
and it works.
Thanks a lot for your help.