jacob

“com.jacob.com.ComFailException: Can't find moniker” Why?

爱⌒轻易说出口 提交于 2019-12-11 04:39:59
问题 I use jacob last version and jacobgen. I put all need dll in c:\windows\system32 I generated wrapper about dll by jacobgen. But I got an exception. Google didn't help. :( com.jacob.com.ComFailException: Can't find moniker May be need registy dlls in windows registry? 回答1: COM objects have to be registered to be found. It does not matter in which folder they reside. Call regsvr32 mycomdll.dll on the dll. 来源: https://stackoverflow.com/questions/2904225/com-jacob-com-comfailexception-cant-find

Better Code Using Jacob and WMI

≯℡__Kan透↙ 提交于 2019-12-11 01:33:03
问题 I am using JACOB to access system information through WMI. I have not found much documentation for WMI and Jacob on the web and was wondering if I could get some help in making the code a little more efficient. Here is the code: ActiveXComponent mActiveXWMI = new ActiveXComponent("winmgmts:\\\\localhost\\root\\CIMV2"); String query = "SELECT * FROM Win32_PerfFormattedData_PerfOS_Processor WHERE Name='_Total'"; Variant vCollection = mActiveXWMI.invoke("ExecQuery", new Variant(query));

Jacob connect to Remote Computer for WMI support

青春壹個敷衍的年華 提交于 2019-12-10 15:15:48
问题 I'm trying to connect to a remote computer using java and Jacob in order to get some WMI Information about the remote computer. For localhost I'm using the code below and it works fine. String host = "localhost"; String connectStr = String.format("winmgmts:\\\\%s\\root\\CIMV2", host); ActiveXComponent axWMI = new ActiveXComponent(connectStr); // other code to get system information But if I change localhost to another ip/hostname I got the following error: Exception in thread "main" com.jacob

JACOB library fails when used in multiple threads

早过忘川 提交于 2019-12-10 11:48:15
问题 I have a strange problem using JACOB from two consequently started identical threads. I have a utility class that uses a static ActiveXObject field for dispatching various requests to the WMI. The first thread works fine. When the second thread is started I get the following exception: com.jacob.com.ComFailException: Can't map name to dispid: ExecQuery at com.jacob.com.Dispatch.invokev(Native Method) at com.jacob.com.Dispatch.invokev(Dispatch.java:858) at com.jacob.com.Dispatch.callN(Dispatch

Jacob : calling vb function in Excel file without invoking “Open” statement

最后都变了- 提交于 2019-12-10 10:56:32
问题 I'm using Jacob to call a VB function that resides in a Macro in an Excel file. Here is my code : [I pass the file and the vb function name as paramaters to the below java method] private static void callExcelMacro(File file, String macroName) { ComThread.InitSTA(); final ActiveXComponent excel = new ActiveXComponent("Excel.Application"); try { // This will open the excel if the property is set to true excel.setProperty("Visible", new Variant(false)); final Dispatch workbooks = excel

Jacob.jar cannot find jacob-1.18-x86.dll

[亡魂溺海] 提交于 2019-12-07 20:10:56
问题 I am trying to write Java code that uses autohotkey, specifically the autoitx4java implementation. I have the imports import java.text.SimpleDateFormat; import java.util.Date; import autoitx4java.AutoItX; As well as have added Jacob.jar, AutoItX4Java.jar and sqljdbc4.jar in the build path (sql jdbc is for other parts of the code). It doesn't compile because of an unsatisfied link error: Exception in thread "main" java.lang.UnsatisfiedLinkError: no jacob-1.18-x86 in java.library.path at java

检测本机是否安装了打开指定格式的软件

拟墨画扇 提交于 2019-12-07 15:31:08
原本的需求是,检测用户电脑上是否已安装word、excel,如果是那就执行转成html的操作, 其中需求的库有jacob和jRegistry jacob: http://sourceforge.net/projects/jacob-project/files/jacob-project/ 这是一个把word、excel啦转换成html的库。 jRegistry: http://sourceforge.net/projects/jregistry/files/jregistry/ 这个是使用java语言操作windows的注册表的库。 这个库都有1一个.jar和.dll文件, jar放到类路径,dll放到 c:\windows\system32 (如果是web项目请把dll放到jre的bin目录下) 下面这段代码的意图,在执行下面的转换操作之前做个判断, 判断是否安装了excel: /** * 检测系统是否存在Excel软件,该方法通过读取注册表里的 [.xls] * 打开方式的默认值确定打开excel文件的软件,有默认值就说明安装了相应软件。 * * @return 存在返回true,否为false */ public static boolean checkExcelIsExists() { RegistryKey r = new RegistryKey( RegistryKey

java.lang.UnsatisfiedLinkError: com.jacob.com.D...

与世无争的帅哥 提交于 2019-12-07 15:30:41
最近做一个系统的维护改善工作,从来没接触过的业务,代码中没有一句注释。各种bug堆积转狂。 一条改到导出word的功能的时候,系统使用了jacob操作但是系统一直报错, Exception in thread "main" java.lang.UnsatisfiedLinkError: no jacob in java.libr ary.path 查了下资料 ,基本都是说没正确的放入library中,并提供了3处以上的位置,实际测试后只要放在 \Java\jdk1.6.0_32\jre\bin下就可以了。 重新配置了myeclipse的jre 选择了tomcat的jdk 重新启动后发现系统仍然报着个错误,考虑我用的是win7 64位 安装的是64位的jdk,重新下载了一个32位的安装了一下,仍然用jacob-1.17-M2-x86.dll 。依据报如上的错误。 于是我将dll重新命名成jacob.dll运行在系统中。 系统报错 j ava.lang.UnsatisfiedLinkError: com.jacob.com.Dispatch.createInstance(Ljava/lang/String;)V 我查了一下大体上是说jar和dll的版本存在冲突,我调试了用最新的版本仍然存在这个问题。 于是怀疑是自己的项目有问题,但是也没有找到什么疑问点。就重新写了一个新项目

linux ls -l 命令出现字段的含义

笑着哭i 提交于 2019-12-07 04:31:33
这个命令可以使用长格式显示文件内容,如果需要察看更详细的文件资料,就要用到 ls -l 这个指令。例如我在某个目录下键入 ls -l 可能会显示如下信息   文件属性 文件数 拥有者 所属的group 文件大小 建档日期 文件名 JacobdeMacBook-Pro:~ Jacob$ ls -l total 8 -rw-r--r-- 1 Jacob staff 3 5 22 10:49 %b drwxr-xr-x 3 Jacob staff 96 5 18 19:09 Applications drwx------+ 5 Jacob staff 160 5 28 19:49 Desktop drwx------+ 20 Jacob staff 640 5 30 16:16 Documents drwx------+ 48 Jacob staff 1536 5 31 09:27 Downloads drwxr-xr-x 2 Jacob staff 64 5 29 19:30 IdeaProjects drwx------@ 65 Jacob staff 2080 5 30 16:13 Library drwx------+ 5 Jacob staff 160 5 20 11:13 Movies drwx------+ 7 Jacob staff 224 5 3 12:41 Music

jacob环境配置:利用jacob操作word的配置和示例

♀尐吖头ヾ 提交于 2019-12-07 01:40:50
配置说明: 1、解压文件:jacob1.1.5-M4.zip ,copy jacob.jar文件加入到classpath 和项目lib下; 2、 copy jacob-1.15-M4-x86.dll 放在java jdk bin目录下,系统目录/WINDOWS/system32目录下,如果服务器写入WORD报错可以检查一下服务器目录下/bin下是否有jacob- 1.15-M4-x86.dll文件; jacob对应不同的JDK有不同的版本,此jacob版本(当然也有人说1.9版本和JDK1.6可以,但是没有具体试过,有兴趣的朋友不妨可以试以下)对应JDK1.6,作者在具体项目中实际用到,确定没问题。。 以下是一个测试操作word的实例: 仅供参考 import com.jacob.activeX.ActiveXComponent; import com.jacob.com.ComException; import com.jacob.com.Dispatch; import com.jacob.com.Variant; public class JacobTest { // 声明一个word对象 private ActiveXComponent objWord; // 声明四个word组件 private Dispatch custDocprops; private