这段递归展开树的程序有什么问题吗?
这段递归展开树的程序有什么问题吗?
当多子项目多的时候,就死机.
HTREEITEM hSubItem ;
if(hItem != NULL)
{
//CString sItem = this->GetItemText(hItem);
TRACE("expand %s \n", sItem);
Expand(hItem,TVE_EXPAND );
hSubItem = GetChildItem(hItem);
}
else
{
return;
}
if(hSubItem!=NULL)
{
expandAllItem(hSubItem);
}
HTREEITEM hSiblingItem = GetNextSiblingItem(hItem);
while((hSiblingItem != NULL)&& (bWithFirstLevel))
{
expandAllItem(hSiblingItem);
hSiblingItem = GetNextSiblingItem(hSiblingItem);
}