Sign in to follow this  
Followers 0
Steward

AutoIT with a Specialty Program's COM

3 posts in this topic

I need help setting up a first button's code by some of you much more experienced since I believe AutoIt is a better fit than Visual Basic. I want to make sure I don't overlook any technicalities or get in any deeper if I can't make any of your suggestions work reliably enough. I did go through the help file Forbidden403's 14 tutorials & Andy Flesner's 2007 book but there is very little covering of the subtleties of connecting AutoIt with another software's COM objects. Somebody told me that the created AutoIt program would have to be registered in Windows 7 to work with the COM objects for one thing. The AutoIt Button1 when clicked must automatically click the created Button in IRCOMMAND2. That is the objective of the the proposed AutoIt program in its simplest form.

I notice in the ObjectViewer in VB6 Pro the COM registered referenced library shows as Global Class IRC2Application Member of IRCOMMAND2

In that same VB6 Pro ObjectViewer it then shows Function ClickButton(Device As String, BtnPath As String) As Boolean Member of IRCommand2.IRC2Application.

Here are a couple of links that tells the it is supposed to be extra simple with any scripting program.

http://www.wdpsoftware.com/IRC2/tn_appnote_userapps.htm

http://www.wdpsoftware.com/downloads/IRC2_COM_Automation.pdf

Attached is the beginning of my code --- I can't help but think that I am overlooking some considerations. Based on my information hopefully I can run some tests on some suggested specific AutoIt code.

Mike

post-62969-0-29353100-1297379670_thumb.g

Share this post


Link to post
Share on other sites



Steward,

I'm very familiar with IRCommand2 (I developed it), but have only just discovered AutoIt. My first reaction to your code is that it doesn't seem to specify an "event" that should occur when your defined button is clicked. That event would be where you'd put the IRCommand2 COM ClickButton command statement.

As I learn more about AutoIt I can perhaps provide more help.

Joe

Share this post


Link to post
Share on other sites

Steward,

Just did a quick scan of the AutoIt docs and found what you're looking for - you need the OnEvent mode to handle button clicks. Here's the doc page on this site:

http://www.autoitscript.com/autoit3/docs/guiref/GUIRef_OnEventMode.htm

In your version of example code you would put the ClickButton statement for IRCommand2 in the OKButton function, which is the event handler for clicks on the OK button.

Joe

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