在java调用AutoItx 时候 加载dll 总是出现下面错误:
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.samples.test.CallDll.JavaCallVbdll(CallDll.java:19)
at com.jacob.samples.test.CallDll.main(CallDll.java:13)
The tutorial says that I should run regsvr32 c:\install\autoitx\autoitx3_x64.dll in cmd but i keep getting the following error:
the module ".....\autoitx3_64.dll" was loaded but the call to DLLRegisterSerer failed with error code 0x80070005
从上的回答我看可以看到,需要在cmd下运行 regsvr32 来注册AutoItX.dll文件,当我运行发现出现 error code
0x80070005
这时候发现因为注册dll都系统盘一般用户是没有权限直接去注册所以这里需要时用管理员的权限去注册。
正确方式:
以管理员的方式运行cmd 输入
regsvr32 c:\install\autoitx\autoitx3_x64.dll
回车即可。
当出现 success 说明dll 文件注册成功。