janus96 Posted October 11, 2007 Posted October 11, 2007 I'm currently using VC++ 2005. The project was generated under CLR/Windows Forms Applications, and the codes for a button click is in the Form1.h file. I've already added the Interop.AutoItX3Lib.1.0 to the references of the project. The new Forms projects look very different from VC6 projects like the DLL example found in C:\Program Files\AutoIt3\AutoItX\StandardDLL\VC6. I've tried adding the #include statement at a couple different places, but would always get compiling errors. If you've had experience using AutoIt as a DLL, please help. Thanks very much in advance.
Richard Robertson Posted October 11, 2007 Posted October 11, 2007 If you are using it as a dll, you don't want Interop.*. That is the .Net IDE wrapping the ActiveX version. All you have to do is declare an AutoIt reference and use it an an object. If you are using the .Net compiler on C++, you will probably just run into issues trying to use the native version unless you feel like doing a lot of work. Just use the wrapped ActiveX.
janus96 Posted October 12, 2007 Author Posted October 12, 2007 If you are using it as a dll, you don't want Interop.*. That is the .Net IDE wrapping the ActiveX version. All you have to do is declare an AutoIt reference and use it an an object.If you are using the .Net compiler on C++, you will probably just run into issues trying to use the native version unless you feel like doing a lot of work. Just use the wrapped ActiveX.Thanks. I got it to work now, and here's how:1. In VC++ 2005, choose File - New - Project - MFC - MFC Application. Enter a project name, say "xxxx".2. Copy and move AutoIt3.h to the project directory created in step 1.3. Copy and move AutoItX3.lib to C:\AutoItX.4. In "xxxxView.cpp", add "#include "AutoIt3.h" to the top of the file.5. Choose menu item "Project - xxxx Properties" (Alt-F7), the Properties Page will pop up.6. Click Configuration Properties - Linker - Input, in Additional Dependencis, enter C:\AutoItX\AutoItX3.lib.7. Choose View - Object Browser, go to xxxx - xxxxView, and then to Properties on your RHS, click Messages.8. Choose WM_LBUTTONDOWN, and choose add function.9. In the function xxxxView::OnLButtonDown(UINT nFlags, CPoint point), add AU3_MouseMove(-500,500,10);Build and test run the program.
Richard Robertson Posted October 12, 2007 Posted October 12, 2007 Well, I can't say that I'm fond of MFC, but I'm glad you figured it out.
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