0

I am fairly new to this, so pardon me if I am asking a silly question.

I created an application in 2006 that calculates bottom-hole pressure. Basically, it takes the user-inputs, calls a secondary application called REFPROP, and delivers the REFPROP results back to my application to continue the calculations. Using AutoIt, I created a temp file with user inputs & another with REFPROP outputs. Since REFPROP was a cmd prompt application, the process was fairly simple.

Now, the REFPROP I incorporated into my application is outdated & the new version has a GUI that requires more than cmd prompts. I would like to use AutoIt3 again, but this time to create a temp Excel file for user inputs, run REFPROP, create a temp output file, and return to my application.

I am somewhat lost as I am unable to run AutoIt scripts within my VB 2010 environment right now. My current plan is to create & compile AutoIt scripts to open & run REFPROP with user inputs, but I am not sure of how exactly to go about that... Does anyone have any idea of the best way to go about this?

Any help with this would be so much appreciated.

Thanks!

user1642458
  • 1
  • 1
  • 2

1 Answers1

0

It's actually very easy. Take a look at the references on the AutoIt script forums and in the manual. Start by working with recordings and move from there.

Use regsvr32 AutoItX3.dll and register the DLL.

Then add a project reference inside the solution

Then run some code like this (This is in C#, but the concept works the same)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutoItX3Lib;

namespace ConsoleApplication2 {
    class Program {
        static void Main(string[] args) {
            AutoItX3Class au3 = new AutoItX3Class();
            while( true ) {
                Console.WriteLine("({0}, {1})" , au3.MouseGetPosX() , au3.MouseGetPosY());

            }
        }
    }
}
alvonellos
  • 1,009
  • 1
  • 9
  • 27
  • Thanks for responding... I will take a look. – user1642458 Sep 07 '12 at 19:23
  • I have reviewed some of the examples/discussion on this forum & am yet to find a way to initiate AutoIT in a Visual Basic solution. Would you be able to send lead me to anything that shows the actual code that I should use if I need to call & run AutoIT scripts in Visual Basic 2010? Thanks. – user1642458 Sep 26 '12 at 00:13
  • http://www.autoitscript.com/forum/topic/136004-call-autoitx-directly-vb-2010/page__hl__+autoitx3lib#entry1002517 Be sure to go and regsvr32 the DLL, and include it as a reference in your project. If you'd like, I'll provide you with a sample project and a batch file to run. – alvonellos Sep 26 '12 at 21:30
  • Did this solution get it working for you? If so, please mark this post as an answer. – alvonellos Sep 30 '12 at 11:00