MFC CTreeCtrl: GetChildItem(hItem) returning NULL
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: MFC CTreeCtrl: GetChildItem(hItem) returning NULL

  1. #1
    Join Date
    Apr 2013
    Posts
    1

    MFC CTreeCtrl: GetChildItem(hItem) returning NULL

    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.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,470

    Re: MFC CTreeCtrl: GetChildItem(hItem) returning NULL

    Do you somehow use cChildren member of TVITEM structure?
    Victor Nijegorodov

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center