Sign in to follow this  
Followers 0
mberry

VB.Net dll trouble

3 posts in this topic

I am somewhat new to .NET and am having difficulty making a valid reference to the AutoItX3 dll file. I am coding in VB using Visual Studio 2005 Professional and the 2.0 Framework. So far, I have only been adding references to the .NET framework, this is my first attempt at adding a COM dll...

As a very simple test, I made a windows application project and I added a project reference to c:\Program Files (x86)\AutoIt3\AutoItx\AutoItX3.dll and then tried to test it using a button click on my default form. I opened the windows Calculator app to perform a simple test...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim obj1 As New AutoItX3Lib.AutoItX3

obj1.WinExists("Calculator")

End Sub

It fails on the Dim line and says...BadImageFormatException was unhandled. Retrieving the COM class factory for component with CLSID {1A671297-FA74-4422-80FA-6C5D8CE4DE04} failed due to the following error: 800700c1.

I am able to use the dll successfully in old school vba in a similar way - just add a reference, then instantiate the AutoItX3 class, but I am missing something in .NET - can anyone help?

Thanks.

Share this post


Link to post
Share on other sites



I have the exact same problem. Been looking for the solution all day please help.

Share this post


Link to post
Share on other sites

Just in case anyone else runs into this problem. I figured out that I needed to set the compiler option to target x86 cpus rather than any cpu. That solved the problem for me.

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