MFC app's process stays open after Element(Find/Get)Child

Class library usage, coding and language questions.
ellinger
Posts: 2
Joined: Tue Dec 19, 2006 2:30 pm

MFC app's process stays open after Element(Find/Get)Child

Post by ellinger » Tue Dec 19, 2006 3:46 pm

Hi,
I am testing an MFC application that incorporates toolbars controls.
The problem I am seeing is that the app's process (as seen in the Task Manager) lingers for several minutes after I close the GUI if my test script calls ElementFindChild, or ElementGetChild to access a toolbar button.
For instance:

controlBarHandle = Ranorex.FormFindChildClassName(formHandle, 'AfxControlBar70s', instance)

toolbarHandle = Ranorex.FormFindChildText(controlBarHandle, 'Standard', Ranorex.MATCH_FROM_START)

toolBarElement = Ranorex.ControlGetElement(toolbarHandle)

#this is the key call - after which the process lingers on close.
#interestingly, it is only this third index that triggers the problem
#other indicies have no similar effect, however those elements are not
#useful here, since it is the third child that contains the button elements.
buttonContainerElement = Ranorex.ElementGetChild(toolBarElement, 3)

buttonElement = Ranorex.ElementGetChild( etc.

Has anyone else seen this?
Thanks,
Bryan

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Wed Dec 20, 2006 11:21 pm

Interesting issue, can you write us the following info please:
  • Windows operation system
    Ranorex version
    Python version
    Compiler of the MFC application
Please try to find the button with FindChild()

Code: Select all

..
toolbarHandle = Ranorex.FormFindChildText(controlBarHandle, 'Standard', Ranorex.MATCH_FROM_START) 
toolBarElement = Ranorex.ControlGetElement(toolbarHandle) 
button = Ranorex.ElementFindChild(toolBarElement, role, elementName)
Does it happen the same?

Jenö Herget
Ranorex Team

ellinger
Posts: 2
Joined: Tue Dec 19, 2006 2:30 pm

Post by ellinger » Thu Jan 04, 2007 5:06 pm

Jenö,

Windows operation system:
Win2k SP4
Ranorex version :
0.9.4 and 1.0.0
Python version
2.4
Compiler of the MFC application
VS6

The problem occurs whether I use Find or Get.

Thanks,
Bryan

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Fri Jan 05, 2007 5:55 pm

It could be a Win2k or an application problem.
Ranorex needs Active Accessibility 2.0, in Windows XP and Windows Server 2003 the full support for MSAA version 2.0 is built into the operating system, Win2k only supports version 1.3.

To find out which version of Active Accessibility is installed on your system, you should check the version of the Oleacc.dll file in the system32 folder on your hard drive. You should have 5.0.0.0 or higher.

If you have an older version, you can use the Active Accessibility 2.0 RDK to upgrade.

See the following Microsoft page:

http://msdn.microsoft.com/library/defau ... bility.asp

Jenö Herget
Ranorex Team