如何使AutoIt参考在C#中工作? [英] How to get AutoIt reference working in C#?

查看:183
本文介绍了如何使AutoIt参考在C#中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为此做准备...

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

我有一个几年前构建的使用AutoItX的旧应用程序-一切正常。

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

是时候尝试更新应用程序了,所以我已经将其升级到VS2012 / .NET4,而我却无法获得对AutoItX库的引用

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.

我已经安装了该应用程序,并使用regsvr32注册了dll,并尝试对引用本身的每种属性设置组合(嵌入互操作类型/隔离),但没有任何乐趣。

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.

每次尝试创建AutoItX3对象时,都会遇到以下错误:

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


由于以下
错误,无法获取具有CLSID
{1A671297-FA74-4422-80FA-6C5D8CE4DE04}的组件的COM类工厂:80040154未注册类(HRESULT异常:
0x80040154(REGDB_E_CLASSNOTREG)。

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)).

我在64位计算机上是否有问题?我不尝试使用64位DLL版本。

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

推荐答案

好的解决方案是:


  1. 打开regedit * 32(c:\windows\syswow64\regedit)

  2. 在HKEY_CLASSES_ROOT中搜索AutoItX \AppID

  3. 我在HKEY_CLASSES_ROOT中找到它\AppID {6E8109C4-F369-415D-AF9A-2AEEFF313234}

  4. 创建一个空白的REG_SZ(字符串)条目DllSurrogate

  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.

参考:如何在Windows Server 2008上使用32位COM对象(适用于2008 R2,但不适用于2008)

这篇关于如何使AutoIt参考在C#中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆