Searching a treeview control
From: Developer (wanderer_at_mapinfo.nope.com)
Date: 02/02/05
- Next message: Developer: "Re: Searching a treeview control"
- Previous message: Mubashir Khan: "Re: example code for doing a dialog based app?"
- Next in thread: Developer: "Re: Searching a treeview control"
- Reply: Developer: "Re: Searching a treeview control"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 2 Feb 2005 11:59:35 -0500
Hello,
I'm working in C, Win32 SDK (legacy app...)
I'm trying to populate a treeview to show a heirarchy. I retrieve nodes
from a db. Each node has a name and a parent's name; I want to search the
tree to find the parent to attach the node to.
My problem is in searching the tree. I'm trying to walk the tree
recursively, searching for the correct node.
Here's the heart of my traversal:
// Check this node for children
hChild = TreeView_GetChild(hWnd, hCurrent);
if (hChild) {
returnPtr = FindTreeNode(winDlg, idCtl, hChild, nodeText);
}
else {
// No children. Does the current node have any siblings?
hSib = hCurrent;
while (hSib && returnPtr == 0) {
hSib = TreeView_GetNextSibling(hWnd, hSib);
returnPtr = FindTreeNode(winDlg, idCtl, hSib, nodeText);
}
}
hCurrent is the node passed in to the function.
I'm not certain about the behavior of TreeView_GetNextSibling. Should it be
hSib = TreeView_GetNextSibling(hWnd, hSib);
or
hSib = TreeView_GetNextSibling(hWnd, hCurrent);
Thanks for any advice...
- Next message: Developer: "Re: Searching a treeview control"
- Previous message: Mubashir Khan: "Re: example code for doing a dialog based app?"
- Next in thread: Developer: "Re: Searching a treeview control"
- Reply: Developer: "Re: Searching a treeview control"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|