Jump to content
Sign in to follow this  
xtalker

Extending Tcl with AutoItX, type mismatch on macros

Recommended Posts

xtalker

AutoIt Gurus,

I'm attempting to add AutoIt commands to the Tcl language using the AutoItX COM interface. Up to this point this has been no problem thanks to the complete and well documented COM interface to AutoIt. The only problem I have is that any time I send a macro or flag to AutoIt, the command fails with:

0x80020005 {Type Mismatch}

Is there an integer value associated with each macro and flag that I could send instead of the @MACRO & @FLAG? Any other ideas?

Thanks in advance!

Bob

In case my Tcl code will help, this is the line that calls my aiRun proc to send the WinSetState command to AutoIt.

aiRun WinSetState Caclulator {} {@SW_MAXIMIZE}

This is the line in aiRun that does the work, I'm using the tcom Tcl library to handle the COM extension which returns the $::autoID handle:

if {[catch { set ret [eval $::autoItID $args ] } errorStr]} {

Share this post


Link to post
Share on other sites
Richard Robertson

I don't know anything about Tcl, but some macros are integers. I don't know what they are but you can check them all using

MsgBox(0, @SW_SHOW, "")

etc.

Edited by Richard Robertson

Share this post


Link to post
Share on other sites
xtalker

I don't know anything about Tcl, but some macros are integers. I don't know what they are but you can check them all using

MsgBox(0, @SW_SHOW, "")

etc.

Thanks Richard, problem solved (almost!)

That was very helpful. Below are many of the values for the properties related to AutoItX (COM interface)

SW_HIDE 0

SW_MAXIMIZE 3

SW_MINIMIZE 6

SW_RESTORE 9

SW_SHOW 5

SW_SHOWDEFAULT 10

SW_SHOWMAXIMIZED 3

SW_SHOWMINIMIZED 2

SW_SHOWMINNOACTIVE 7

SW_SHOWNA 8

SW_SHOWNOACTIVATE 4

SW_SHOWNORMAL 1

The only unknowns are the "error" (which would be real handy to know) and "version". Any ideas on these?

Thanks again,

Bob

Share this post


Link to post
Share on other sites
MHz

AutoIt Gurus,

I'm attempting to add AutoIt commands to the Tcl language using the AutoItX COM interface. Up to this point this has been no problem thanks to the complete and well documented COM interface to AutoIt. The only problem I have is that any time I send a macro or flag to AutoIt, the command fails with:

0x80020005 {Type Mismatch}

Is there an integer value associated with each macro and flag that I could send instead of the @MACRO & @FLAG? Any other ideas?

Thanks in advance!

Bob

In case my Tcl code will help, this is the line that calls my aiRun proc to send the WinSetState command to AutoIt.

aiRun WinSetState Caclulator {} {@SW_MAXIMIZE}

This is the line in aiRun that does the work, I'm using the tcom Tcl library to handle the COM extension which returns the $::autoID handle:

if {[catch { set ret [eval $::autoItID $args ] } errorStr]} {

Have a look at COM properties in the AutoItX help file. Google seems to tell me that TCL uses constants such as SW_HIDE, SW_MAXIMIZE...so give them a try. Some TCL code here seems to show some usage but that is coming from my knowledge of no TCL experience.

Share this post


Link to post
Share on other sites
MHz

The only unknowns are the "error" (which would be real handy to know) and "version". Any ideas on these?

error would be set to non zero when an error does happen. It is not a constant.

version is set to the version of AutoItX so the value will be available at runtime.

:)

Share this post


Link to post
Share on other sites
xtalker

error would be set to non zero when an error does happen. It is not a constant.

version is set to the version of AutoItX so the value will be available at runtime.

:)

How about that, it seems that the @SW_* flags are actually Windows related constants, I didn't think to Google them explicitly!

How to read error still is a mystery to me. I just dont see a method to read error (or version for that matter). This may not be a big problem as long as I check the return values of the AutoIt commands for errors.

Bob

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  

×