I have this python script that imports a zkemkeeper
dll and connects to a time attendance device(ZKTeco
). Here is is a script I\'m using:
The two choices for calling native code from Java are JNI (Java Native Interface) and JNA (Java Native Access)
The Java runtime can do JNI out of the box, but you need to create a wrapper library with functions specifically made for JNI (just putting in a native
keyword is not enough).
JNA is a 3rd party library that uses libffi to make native code accessible from Java.
You have to see for yourself which approach better suits your needs.
Edit: looking at your example code again, is that a COM call? While COM can be done with JNA (doing that myself), it's quite complicated. Your best bet is probably a wrapper C library that does the actual calls or a Java/COM bridge product like JACOB (have never used it, however).