- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在学习本教程:http://www.joecolantonio.com/2014/07/02/selenium-autoit-how-to-automate-non-browser-based-functionality/在 Windows 中自动化非浏览器应用程序。
import java.io.File;
import autoitx4java.AutoItX;
import com.jacob.com.LibraryLoader;
import java.lang.System;
public class CalcTest {
/**
*
* Returns if the JVM is 32 or 64 bit version
*/
public static String jvmBitVersion(){
return System.getProperty("sun.arch.data.model");
}
public static void main(String[] args) throws InterruptedException {
String jacobDllVersionToUse;
if (jvmBitVersion().contains("32")){
jacobDllVersionToUse = "jacob-1.18-x86.dll";
}
else {
jacobDllVersionToUse = "jacob-1.18-x64.dll";
}
File file = new File("lib", jacobDllVersionToUse);
System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());
AutoItX x = new AutoItX();
x.run("calc.exe");
x.winActivate("Calculator");
x.winWaitActive("Calculator");
//Enter 3
x.controlClick("Calculator", "", "133") ;
Thread.sleep(1000);
//Enter +
x.controlClick("Calculator", "", "93") ;
Thread.sleep(1000);
//Enter 3
x.controlClick("Calculator", "", "133") ;
Thread.sleep(1000);
//Enter =
x.controlClick("Calculator", "", "121") ;
}
}
我收到以下错误:
Exception in thread "main" 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:99)
at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58)
at autoitx4java.AutoItX.<init>(AutoItX.java:181)
at CalcTest.main(CalcTest.java:30)
教程说我应该在 cmd 中运行 regsvr32 C:\install\AutoItX\AutoItX3_x64.dll
但我一直收到以下错误:
The module "C:\install\AutoItX\AutoItX3_x64.dll" was loaded but the call to DllRegisterServer failed with error code 0x80070005
我不知道该怎么做。
最佳答案
以下解决方案对我有用:
复制 AutoItX3_x64.dll
文件。您可以在 C:\Program Files (x86)\AutoIt3\AutoItX
中找到它。
将其粘贴到C:\Windows\System32
。
打开 cmd 提示符,以管理员身份运行。键入 regsvr32 AutoItX3_x64.dll
并按 Enter。
AutoItX3_x64.dll中的DllRegisterServer注册成功,会有提示
关于windows - 线程 "main"com.jacob.com.ComFailException : Can't co-create object 中的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37141288/
我在运行下面的代码时遇到异常线程“main”com.jacob.com.ComFailException中的异常:无法共同创建对象。 我上网寻求帮助。有些网站说我需要注册我的 dll。我尝试使用 re
我正在使用 Jacob 一个 Java-COM 桥接器,并且我已将所需的 dll 放置到 -C:\WINDOWS\system32\jacob-1.14.3-x86.dll。我还将所需的 jar 文件
我使用 jacob 最新版本和 jacobgen。 我把所有需要的dll放在c:\windows\system32 我通过 jacobgen 生成了有关 dll 的包装器。 但我有一个异常(excep
我一直在尝试使用 Jacob 从 Java 调用 dll 函数,但没有成功。我已经按照此处所述使用 regasm 完成了 dll 的注册 - http://www.dreamincode.net/fo
我正在学习本教程:http://www.joecolantonio.com/2014/07/02/selenium-autoit-how-to-automate-non-browser-based-f
我正在尝试制作人脸检测和比较代码。现在对于这个项目,我将使用ZZActiveX2.0。所以我使用 jacob 来访问 Active X。我下载了 jacob-1.19 并将 jacob-1.19-x8
我正在做一个连接门禁和考勤机的项目我发现这个项目在 github 中使用 java 连接到相同类型但为了我想设置 CardNumber 属性,我有一个异常(exception)“com.jacob.c
我是一名优秀的程序员,十分优秀!