Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
visit(root);// call recursive function with the root of the
// tree as your starting point
function visit(Node){
Iterator children = Node.getChildren();
// get all the children or branches or whatever you want
// to call them
while(it.hasNext(){
visit(it.next());
}
// then process your current node, or process it first
// depending on what exactly you're doing
}// end visit function
void traverse(CTreeCtrl* pCtrl, HTREEITEM hItem)
{
if(!hItem)return; // handle null
traverse(pCtrl->GetNextSiblingItem(hItem));
traverse(pCtrl->GetChildItem(hItem);
// do stuff with hItem
}[code]
I think it would look something like this.
Matt
CTreeCtrl& ctl;
//fill your tree
HTREEITEM hItem = ctl.GetRootItem();
traverse(hItem);
//then use this function
void traverse(HTREEITEM &hItem){
//process your hItem here
HTREEITEM hItemTmp=GetChildItem(hItem);
while(hItemTmp!=NULL)
traverse(hItemTmp);
hItemTmp=GetNextSiblingItem(hItemTmp);
}
}