Sign in to follow this  
Followers 0
nusaki

neet help please, Autoit + VB net 2010

8 posts in this topic

#1 ·  Posted (edited)

Can't to add auto-it to VB 2010 .Net 2010

My code:

Imports AutoItX3Lib
Public Class Form1
    Dim cAutoit As New AutoItX3Lib.AutoItX3

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.I Then
            cAutoit.Send("!k")
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
End Class

I get "An error occurred creating the form. See Exception.InnerException for details. The error 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))."

Please hep me solve it

Edited by nusaki

keywen.com

Share this post


Link to post
Share on other sites



The error indicates that you havent registered the AutoItX3.Control on your PC.

I guess you missed this when you were RT'ing the FM?

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

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

Here is an example of calling a the Run method of the control from VBScript:

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

oAutoIt.Run("notepad.exe")

Share this post


Link to post
Share on other sites

I can't use regsvr32 because of user rights, do you know how to do it then?

Share this post


Link to post
Share on other sites

Whenever I add this to General Section in .NET 2010 it says it failed to load:

Dim cAutoit As New AutoItX3Lib.AutoItX3

That works fine in VB6.

Am I missing something? I already added it to references and registered it.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

JohnOne - it indeed is, but it is quite not acceptable for my case as i seek the most non problematic solution. I still think that manifest is the way to make it work.

IE. i would like application to deploy in various enterprise environments without need for administrator to create scripts that would register autoitX on all clients within domain.

Edited by evlo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0