I have a simple demo which can do some MS office automation like create Outlook email item and create Word documents, basically my code is following the example from:
https://github.com/java-native-access/jna/tree/master/contrib/msoffice .
The example code works fine with JNA 4.1.0, but when I update JNA to latest 4.2.1 release, it's broken.
I get the following exception:
Exception in thread "main" com.sun.jna.platform.win32.COM.COMException: A null reference pointer was passed to the stub. (puArgErr=)
at com.sun.jna.platform.win32.COM.COMUtils.checkRC(COMUtils.java:112)
at com.sun.jna.platform.win32.COM.COMUtils.checkRC(COMUtils.java:95)
at com.sun.jna.platform.win32.COM.COMBindingBaseObject.oleMethod(COMBindingBaseObject.java:217)
at com.sun.jna.platform.win32.COM.COMBindingBaseObject.oleMethod(COMBindingBaseObject.java:322)
at com.sun.jna.platform.win32.COM.COMLateBindingObject.invokeNoReply(COMLateBindingObject.java:422)
at testjna.MSExcel.quit(MSExcel.java:42)
at testjna.MSOfficeDemo.testMSExcel(MSOfficeDemo.java:120)
at testjna.MSOfficeDemo.<init>(MSOfficeDemo.java:21)
at testjna.MSOfficeDemo.main(MSOfficeDemo.java:13)
following the error it comes from the native code. does anyone encountered the same problem?
Thanks.