Accessing data in custom MFC C++ control

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
tcalderwood
Posts: 8
Joined: Thu May 05, 2011 10:07 pm

Accessing data in custom MFC C++ control

Post by tcalderwood » Fri Jan 18, 2013 6:39 pm

We have a custom drawn MFC C++ control that we rely on to display information to the user. The information in the custom drawn box is filled with text. I was told at one time that we just needed to add in a hook to access this information. However, I can not find the example code that I thought I had. Has anybody had luck adding a hook to get at data in a custom drawn control and if so, can I get a copy of your source code please?

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Accessing data in custom MFC C++ control

Post by sdaly » Mon Jan 21, 2013 9:37 am


tcalderwood
Posts: 8
Joined: Thu May 05, 2011 10:07 pm

Re: Accessing data in custom MFC C++ control

Post by tcalderwood » Mon Jan 21, 2013 9:30 pm

That almost works! We can get the data out of the custom control just like the article described. The problem is that our custom control contains a set of text box custom controls and Ranorex does not distinguish between these text box custom controls. It lumps all the text data together.

I have attached a screen capture of the custom control below.
Capture.png
Capture.png (13.12 KiB) Viewed 2871 times


The outer control is called the Tabular Display. Within the Tabular Display, you have individual Tabular Display Blocks (TD Block). Each TD Block has it own set of text/data that we need access. The way Ranorex sees the data is as follows.
ElementDisplay.png
ElementDisplay.png (21.83 KiB) Viewed 2871 times
We would really like to be able to grab the data by individual TD Blocks instead of having to parse through the data as some data is dynamic over time. Do you know if this is possible?
Timothy A Calderwood
Senior Engineer
PLEXSYS Interface Products Inc.
4900 NW Camas Meadows Drive
Camas, WA 98607
360.838.2500
360.838.2550 fax

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Accessing data in custom MFC C++ control

Post by Support Team » Tue Jan 22, 2013 5:53 pm

Hello,

That's not so easy to achieve because the rawText elements are listed in the same node and there is no element for the cell in your table.
Which version of Ranorex do you use?
Are there some other properties which can be used to find out the current cell?
Could you please send us a snapshot file from your Element in order to analyze your element.
Thank you!

Regards,
Bernhard
.
Image

tcalderwood
Posts: 8
Joined: Thu May 05, 2011 10:07 pm

Re: Accessing data in custom MFC C++ control

Post by tcalderwood » Wed Feb 27, 2013 8:42 pm

We are currently using Ranorex 4.0.1.21107. There is nothing specific that we can use easily use. Is there a COM+ option that would allow us to access each block? As per the screenshot, I am not sure what your asking for. As soon as I figure that out, I will post it here. Thanks for your help.
Timothy A Calderwood
Senior Engineer
PLEXSYS Interface Products Inc.
4900 NW Camas Meadows Drive
Camas, WA 98607
360.838.2500
360.838.2550 fax

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Accessing data in custom MFC C++ control

Post by Support Team » Thu Feb 28, 2013 5:26 pm

Hello,

In order to create a Ranorex Snapshot file please read the following section in our user guide:
http://www.ranorex.com/support/user-gui ... files.html

Thank you!
Regards,
Bernhard
.
Image

tcalderwood
Posts: 8
Joined: Thu May 05, 2011 10:07 pm

Re: Accessing data in custom MFC C++ control

Post by tcalderwood » Thu Feb 28, 2013 9:39 pm

Attached is a snapshot that you requested. What we are trying to do is access each "block" of data found in element '59649'. In the attached screen capture, you can see the first 2 blocks with data, the rest of the blocks are blank.

Back when we first looked at Ranorex at StarEast, I was told that there was a COM+ way to add a hook that would allow us to access each block independently. Is that still an option on the table?
Attachments
EntityArea.png
EntityArea.png (16.95 KiB) Viewed 2787 times
EntityArea.rxsnp
The part we are trying to get data out of is Element '59649'.
(396.69 KiB) Downloaded 197 times
Timothy A Calderwood
Senior Engineer
PLEXSYS Interface Products Inc.
4900 NW Camas Meadows Drive
Camas, WA 98607
360.838.2500
360.838.2550 fax

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Accessing data in custom MFC C++ control

Post by Support Team » Fri Mar 01, 2013 3:39 pm

Hello,

Thank you for the snapshot file.
I have seen that there is an attribute named "Column".
You will find all elements within this column using the following RanoreXPath:
/form/container/form/element/element[@controlid='59649']/rawtext[@column='0']
I'm afraid that you have to write some code to get the elements separated by the blocks in your test script.
Can you remember which guy told you to set a hook in order to split the blocks?
Thank you!

Regards,
Bernhard
.
Image