Jump to content

Extending Tcl with AutoItX, type mismatch on macros


xtalker
 Share

Recommended Posts

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]} {

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.

:)

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...