Thanks for your code. I checked and it is really similar to mine.
1) Just to be clear: I built a dll: "PicoNative.dll" that implements the function "JNIEXPORT void JNICALL Java_com_iba_device_PicoNative_connect(JNIEnv * env, jobject object)"
-I'm calling this function from Java using the method "public native void connect()". This gives a crash.
-I'm calling this exact same function in the same dll from another C executable and it works perfectly.
2) I checked this with the double-head USB cable and with the external PS and it gives the same behaviour.
3) Unfortunately, the C function creating the problem ("ps5000aCurrentPowerSource") does not give back any status code (neither in C, neither in Java)
3) I used the tool DependencyWalker and I noticed I don't have the same system dll loaded in both cases:
a. When I execute the code from the EXE file (without java), the system loads the dll's from C:\Windows\System32
b. When I execute the code from Java, the system loads the dll's from C:\Windows\SysWOW64\
I'm currently trying to force Java to load the same dll's, but without success until now. I'm also hoping that the 64-bits dll will solve this issue. If I can have this working, I will publish my wrapper.
Thanks a lot for your help.