1

I am using AutoIt dll in my C# application to get data from active windows of other program. On my computer, where I compile this application, it works OK, but when I tried to run it on other computer I got exception:

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)

What could be wrong in this situation?

0

2 Answers 2

3

The computer you're trying to run your code on hasn't had the AutoIt COM interface registered. The following is from the AutoItX documentation:

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

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

3 Comments

I think you probably need to register the dll from an elevated command prompt, or see this question: stackoverflow.com/questions/14644258/…
Okay. So could you give me a little advice, what can I do if I want to share my application? That I don't need to hange any values manually//
Easiest way is probably a batch file to automate the changes
2

Adding to the correct answer - Visual Studio has an out-of-the-box project template to create an installer for your application. That will allow you to include the dll in an installation routine. As a result sharing the software becomes a pleasant experience to the recipient.

Comments

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.