Jump to content

Incorrect control is sometimes idenentified


Bowmore
 Share

Recommended Posts

Would any one like to comment on the following observation.

I'm unsure if this is the expected behaviour / something specific to the application I am automating or a bug that needs to be reported.

Background info

I am automating a GIS application ESRI's ArcMap.

"AfxControlBar70u" is the class of the container control where the docked toolbars sit

"ArkansasCoolBar" is the class of the toolbars

The "AfxControlBar70u" control always has the same hidden text as the last toolbar move or modified

The following line of code will return the handle to the "AfxControlBar70u" class control if it has the same text, rather than the expected "ArkansasCoolBar" class control. It seems as though when using the special description method AutoIt is finding a match for the TEXT: and not bothering to check if CLASS: also matches.

$hToolbar = ControlGetHandle( "urbanExtent.mxd - ArcMap - ArcEditor", "", "[CLASS:ArkansasCoolBar; TEXT:EditClient Survey]")oÝ÷ ØÈ~*ìµÉ^j»az×±¶íꮢÐÄ*'¶º%ªûÒꮢ×(Ú%jË!£   ÛzZ0¶§¶¡jwezÚ-ç(®·µÊ'¶º%ÊÞ¶êçyÖ®¶­s`6öçG&öÅ6WEFWBgV÷C·W&&äWFVçBæ×BÒ&4ÖÒ&4VFF÷"gV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä54äã¤g6öçG&öÄ&#sSÒgV÷C²ÂgV÷C²gV÷C² b33c¶FööÆ&"Ò6öçG&öÄvWDæFÆRgV÷C·W&&äWFVçBæ×BÒ&4ÖÒ&4VFF÷"gV÷C²ÂgV÷C²gV÷C²ÂgV÷Cµ´4Ä53¤&¶ç646ööÄ&#²DUC¤VFD6ÆVçB7W'fWÒgV÷C²

This behaviour has been observed with a number of control functions not just ControlGetHandle() function so I believe it related to the way the 'special description method' is implemented in AutoIt.

Please note that I am not looking for a solution as I have access to the instance and ID values of the controls and can therfore use CLASSNN: or ID: to successfully identify the correct toolbar control. I would have liked to use the TEXT: value as this makes the code easier to understand i.e. self documenting;

Thanks

Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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...