0
我正在處理一個項目,我正面臨MFC樹控件的困難。我想檢查是否有任何其子節點被選中。當父節點被選中(非擴展),當我在父對象上使用GetChildItem()時,它返回null。如果我在擴展父節點之後重複相同的操作,並再次摺疊它返回子項。MFC Treeview:不返回其子節點的父節點
if(this->ItemHasChildren(hItem)) //returning true (and i am sure that it has children)
{
HTREEITEM hChild = this->GetChildItem (hItem); //returning NULL;
}
如果我展開並摺疊樹,上面的代碼不會返回NULL。
看來你並不孤單有這個bug ... https://www.google.pt/search?client=opera&q=GetChildItem&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest#channel=suggest&q=GetChildItem +的CTreeCtrl – sergiol 2014-04-05 03:32:34