gpt4 book ai didi

C# 应用程序使用 AutoIt.dll 问题

转载 作者:太空宇宙 更新时间:2023-11-03 21:05:36 28 4
gpt4 key购买 nike

我在我的 C# 应用程序中使用 AutoIt dll 从其他程序的事件窗口获取数据。在我编译此应用程序的计算机上,它运行正常,但是当我尝试在其他计算机上运行它时出现异常:

System.Runtime.InteropServices.COMException (0x80040154): Pobranie fabryki klasy COM dla składnika o identyfikatorze CLSID {1A671297-FA74-4422-80FA-6C5D8CE4DE04} nie powiodło się z powodu następującego błędu: 80040154 Klasa niezarejestrowana. (Wyjątek od HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

w System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
w System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
w System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) w System.Activator.CreateInstance(Type type, Boolean nonPublic) w System.Activator.CreateInstance(Type type) w GetFromGam.GetFromGamForm.receiveData() w GetFromGam.GetFromGamForm.receiveButton_Click(Object sender, EventArgs e) w System.Windows.Forms.Control.OnClick(EventArgs e) w System.Windows.Forms.Button.OnClick(EventArgs e) w System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) w System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) w System.Windows.Forms.Control.WndProc(Message& m) w System.Windows.Forms.ButtonBase.WndProc(Message& m) w System.Windows.Forms.Button.WndProc(Message& m) w System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) w System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) w System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

在这种情况下可能出了什么问题?

最佳答案

您尝试在其上运行代码的计算机尚未注册 AutoIt COM 接口(interface)。以下内容来自 AutoItX 文档:

Using the COM Interface Before you can use the COM interface to AutoItX it needs to be "registered" (This is done automatically when you install the full version of AutoIt but you may need to do it manually if you are using AutoItX separately).

To register the COM interface:

  1. Open a command prompt

  2. Change directory (using CD) to the directory that contains AutoItX3.dll

  3. Type regsvr32.exe AutoItX3.dll and press enter

The name of the AutoItX control is AutoItX3.Control

关于C# 应用程序使用 AutoIt.dll 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41368247/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com