sastowe
14 years agoSuper Contributor
super frustrating issue with findallchildren
I use TC 7.2 right now. I have a script that worked all last week. Now it is bombing on an object that it never finds.
Sys.Refresh
aobj = frmRules.FindAllChildren("WndClass", "XTPDockingPaneTabbedContainer", 1, true)
For j = 0 to UBound(aobj)
if aobj(j).WaitVBObject("picTesting", 1000).Exists then
set pic = aobj(j).VBObject("picTesting")
Sys.Refresh
PropArray = Array("WndClass", "Index")
ValuesArray = Array("XTPDockingPaneTabbedContainer", 4)
set objContainTestingTree = pic.FindChild(PropArray, ValuesArray, 1, true)
if objContainTestingTree.WaitVBObject("picTestingTreeView", STD_WAIT).Exists Then
set tree = objContainTestingTree.VBObject("picTestingTreeView").Window("AfxOleControl42", "", 1).VBObject("TreeViewTesting")
end if
Exit for
end if
Next
' Select all nodes
Set objSelectedNodes = tree.SelectedNodes
When it gets to tree.SelectedNodes, the object tree is not found. I can SEE it in the object browser. I have been running this script all last week, then Sunday BAM it stopped working. Right smack in the middle of my time critical validation cycle.
Sys.Refresh
aobj = frmRules.FindAllChildren("WndClass", "XTPDockingPaneTabbedContainer", 1, true)
For j = 0 to UBound(aobj)
if aobj(j).WaitVBObject("picTesting", 1000).Exists then
set pic = aobj(j).VBObject("picTesting")
Sys.Refresh
PropArray = Array("WndClass", "Index")
ValuesArray = Array("XTPDockingPaneTabbedContainer", 4)
set objContainTestingTree = pic.FindChild(PropArray, ValuesArray, 1, true)
if objContainTestingTree.WaitVBObject("picTestingTreeView", STD_WAIT).Exists Then
set tree = objContainTestingTree.VBObject("picTestingTreeView").Window("AfxOleControl42", "", 1).VBObject("TreeViewTesting")
end if
Exit for
end if
Next
' Select all nodes
Set objSelectedNodes = tree.SelectedNodes
When it gets to tree.SelectedNodes, the object tree is not found. I can SEE it in the object browser. I have been running this script all last week, then Sunday BAM it stopped working. Right smack in the middle of my time critical validation cycle.