Windows 10 jacob ComObject with java 6 not working anymore since Windows 10 1809

  • Thread starter Thread starter Stephannnnn
  • Start date Start date
S

Stephannnnn

Guest
Hi,

is it possible that MS changed something on the ComObject level with 1809? We have an old legacy app which uses Java version 1.6 update 45 (jdk-6u45-windows-i586.exe) and jacob.dll 1.8 (jacob_18.zip), and stopped working with the latest major update and even 19H1.

It seems that the comobject behavior has changed and causes an error by calling the open command. But even if an error occures, the word document gets opend, but changes in the document cannot be saved.

I could reproduce the issue in java with following code, of course you have to import the jacob.dll/jar:


import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Variant;
import com.jacob.com.Dispatch;


ActiveXComponent oWord = new ActiveXComponent("Word.Application");
oWord.setProperty("Visible", new Variant(true));

Dispatch documents = oWord.getProperty("Documents").toDispatch();

String str_file = "C:/temp/test.rtf";

Dispatch doc = Dispatch.invoke(documents, "Open", Dispatch.Method,
new Object[]{str_file},
new int[1]).toDispatch();




The error I get is:


Exception in thread "main" com.jacob.com.ComFailException: A COM exception has been encountered:

At Invoke of: Open
Description: An unknown COM error has occured.
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:384)
at com.jacob.com.Dispatch.invoke(Dispatch.java:267)
at Main.main(Main.java:21)



Line 384 and 267 are referring to this line of code in the jacob:






return invokev(dispatchTarget, name, wFlags, obj2variant(oArg), uArgErr);


I know it is not the best idea not updating the legacy app itself, but what can I say, it is as it is.

Any ideas what might have changed in Windows >= 1809 or how it can be solved without touching the app?

Thanks

Stephan

More...
 
Back
Top