Making CTreeCtrl Accessible to Ranorex
Making CTreeCtrl Accessible to Ranorex
Recently I have been working on getting a CTreeCtrl subclass to show up in Ranorex, but it has been surprisingly difficult. Although Ranorex correctly shows the tree structure (i.e. nodes are arranged correctly), every node is shown simply as 'TreeItem' without the actual node text. Most other accessible properties (such as screen location or visibility) are also empty or zeroed out. Shouldn't the default CTreeCtrl implementation of IAccessible already provide correct information? As a test, I overrode get_accChildCount in the subclass, and browsing the control with Ranorex doesn't cause it to be called. However, browsing it with AccExplorer does result in the method getting called. Is there something special I must do to make the CTreeCtrl work well with Ranorex? Any suggestions would be appreciated.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Making CTreeCtrl Accessible to Ranorex
Hi,
Please take a look to following blog. In this blog will be explained how to enable automation for third party controls. http://www.ranorex.com/blog/enabling-au ... s-controls
We have also a new Plug-In for such controls. Please take a look to following blog
http://www.ranorex.com/blog/automation- ... re-plug-in
Regards,
Peter
Ranorex Team
Please take a look to following blog. In this blog will be explained how to enable automation for third party controls. http://www.ranorex.com/blog/enabling-au ... s-controls
We have also a new Plug-In for such controls. Please take a look to following blog
http://www.ranorex.com/blog/automation- ... re-plug-in
Regards,
Peter
Ranorex Team
Re: Making CTreeCtrl Accessible to Ranorex
Thanks for the response and the links. I should have mentioned that the CTreeCtrl I'm using is the basic one provided in MFC, so it's not a third-party product. Do you still think I'll need to add my own accessible methods to make it work with Ranorex?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Making CTreeCtrl Accessible to Ranorex
Hi,
For such legacy controls, I would suggest you to use the RawText Plug-In. You don't need to implement accessibility to your element if you use this Plug-In. Have you tried it yet?
Regards,
Peter
Ranorex Team
For such legacy controls, I would suggest you to use the RawText Plug-In. You don't need to implement accessibility to your element if you use this Plug-In. Have you tried it yet?
Yes you need your own accessible methods that Ranorex can access the elements of the tree.gorodish wrote: Do you still think I'll need to add my own accessible methods to make it work with Ranorex?
Regards,
Peter
Ranorex Team
Re: Making CTreeCtrl Accessible to Ranorex
Well, it turns out that the issues I had been seeing came down to user error. Our app is 32-bit but I had been using the 64-bit version of Ranorex Spy.
Thanks for your help, and sorry for the wasted energy.
By the way, the RawText plugin looks really cool.

By the way, the RawText plugin looks really cool.