MFC CTreeCtrl ItemHasChild()返回true但getChildItem()返回NULL

时间:2013-04-26 11:24:00

标签: visual-c++ mfc

在我的程序中,当我检查Treeview而不扩展时,ItemHasChild()返回true但GetChildItem()返回NULL。我搜索了解决方案并提出了一些解决方案。一个是在GetChildItem()[不起作用]之前进行扩展和折叠,另一个是设置TVINSERTSTRUCT的变量。我不明白后者。

if(this->ItemHasChildren(hItem))  //returning true (and i am sure that it has children)
{
    HTREEITEM hChild = this->GetChildItem (hItem);  //returning NULL;
}

0 个答案:

没有答案
相关问题