I am trying to use autoit with java, and have installed AHK and the jacob bridge to autoitx4java.AutoItx. I have the jacob dll (jacob-1.18-86x.dll) stored in windows/syswow64 . When I try to compile the program (imports are import java.text.SimpleDateFormat; import java.util.Date; import autoitx4java.AutoItX;)
, I get an error
Exception in thread "main" com.jacob.com.ComFailException: Can't get object clsid from progid
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 MainTest.login(MainTest.java:126)
at MainTest.setadmin(MainTest.java:181)
at MainTest.runbasic(MainTest.java:21)
at MainTest.main(MainTest.java:15)
After searching, I thought it might be that the dll wasn't registered, such as at How to create an object using JACOB , but that didn't work. After typing the registering command from there, I get a "RegAsm : error RA0000 : Failed to load 'c:\windows\syswow64\jacob-1.18-x86.dll' because it is not a vaild .NET assembly. Also tried "regsvr32 jacob-1.18-x86.dll" from another way to register outside of the answer above, but that got me a "The module "jacob-1.18-x86.dll" was loaded but the entry-point DllRegisterServer was not found. Make sure that "jacob-1.18-x86.dll" is a valid DLL or OCX file and try again. Any ideas?
Edit: Someone suggested this was for AutoIt and not autohotkey. This is corrected in the question and the tags. Thanks,
By just registering only AutoITX3 DLL, issue has been resolved. For Win32: AutoItX3.dll and Win64: AutoItX3_x64.dll
Register using command: regsvr32 AbsolutePathOfRequiredDLLFile