Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3021

MFC CTreeCtrl: GetChildItem(hItem) returning NULL

$
0
0
Hi,

I want to check whether any of the files in the MFC tree control has been checked. In the below code the ItemHasChildren is returning true but GetChildItem is returning NULL. Can anyone please help me with this issue.

Code:

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

If i had expanded the tree before it is not returning NULL.

Viewing all articles
Browse latest Browse all 3021

Trending Articles