自从迁移到 Lync 2013 以来,我的代码在
ActiveXComponent officeCommunicatorActiveX = new ActiveXComponent("Communicator.UIAutomation");
有这个特例:
Exception in thread "Thread-10" com.jacob.com.ComFailException: Can't co-create object
at com.jacob.com.Dispatch.createInstanceNative(Native Method)
at com.jacob.com.Dispatch.<init>(Dispatch.java:101)
我尝试了一些在线解决方案,但都没有奏效。Lync 在 32 位模式下运行,我使用 bot 32 和 64 位 JDK 运行我的应用程序 - 没关系。我用错了 JACOB 吗?
编辑:在运行此代码之前,我选择我的 JACOB dll:
if (shouldLoad32Bit()) {
System.setProperty(LibraryLoader.JACOB_DLL_PATH, Files.JACOB_32.getAbsolutePath());
} else {
System.setProperty(LibraryLoader.JACOB_DLL_PATH, Files.JACOB_64.getAbsolutePath());
}