Page 1 of 1

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

Posted: Tue Dec 19, 2006 3:46 pm
by ellinger
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

Posted: Wed Dec 20, 2006 11:21 pm
by webops
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

Posted: Thu Jan 04, 2007 5:06 pm
by ellinger
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

Posted: Fri Jan 05, 2007 5:55 pm
by webops
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