3

I'm pulling my hair out on this one...

I have a legacy application I built a few years ago that uses AutoItX - all working fine.

The time has come to try and update the app, so I've upgraded it to VS2012/.NET4 and I simply cannot get a reference to the AutoItX library to work.

I have installed the application, have registered the dll with regsvr32, tried every combination of property settings on the reference itself (Embed Interop Types / Isolated), but no joy.

The error I keep getting whenever I try and create an AutoItX3 object is:

Retrieving the COM class factory for component with CLSID {1A671297-FA74-4422-80FA-6C5D8CE4DE04} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Is it an issue that I'm on a 64-bit machine? I'm not trying to use the 64-bit DLL version.

0

2 Answers 2

9

Okay the solution was:

  1. Open up regedit*32 (c:\windows\syswow64\regedit)
  2. Search for AutoItX in HKEY_CLASSES_ROOT\AppID
  3. I found it in HKEY_CLASSES_ROOT\AppID{6E8109C4-F369-415D-AF9A-2AEEFF313234}
  4. Create a blank REG_SZ (String) entry called DllSurrogate

For some reason, this completely solved the issue.

Reference: How to use a 32 bit COM object on Windows Server 2008 (works on 2008 R2 but non 2008)

Sign up to request clarification or add additional context in comments.

Comments

2

Hainesy,

do you use a x64-Windows? I had the same problem when I was starting to have a look at COM. If so, you should try to register your class in HKEY_LOCAL_MACHINE\SOFTWARE\WoW6432Node\Classes...

Give it a try!

Greeting

2 Comments

Yes I do! Could you give me a bit more information about how I'm supposed to register the class in there? Is there a command line way of registering it?
Well, you could try a reg-script. I just started COM myself and did everything manually. Essentially you need to register your CLSID in HKEY_LOCAL_MACHINE\SOFTWARE\WoW6432Node\Classes\{YOUR-CLSID}\ (Path to DLL (InprocServer32), HKEY_LOCAL_MACHINE\SOFTWARE\WoW6432Node\Interface\{YOUR-IID}\ If you have ever registered an Inprocess-server, you need to put everything into HKEY_LOCAL_MACHINE\SOFTWARE\WoW6432Node\ just like you did to HKEY_LOCAL_MACHINE\SOFTWARE\ on a 32-bit machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.