mberry Posted July 5, 2007 Share Posted July 5, 2007 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. Link to comment Share on other sites More sharing options...
sumiflow Posted July 12, 2008 Share Posted July 12, 2008 I have the exact same problem. Been looking for the solution all day please help. Link to comment Share on other sites More sharing options...
sumiflow Posted July 12, 2008 Share Posted July 12, 2008 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now