|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi Ive got a treeview control and I want to go through every node on the tree to locate an item.
Can any1 give me the basic gist of the recursive function I need to write pls? I need to be able to go through every node and when I find the item in the leaf node I want to be able to jump back to its parent and move onto the next parent node. THANKS!!! I have the following so far TVITEM NodeStruct = {0}; HTREEITEM hTreeItem = NULL; int NodeType = 0; // The current type of node selected int Position = 0; // if present the command position. Needed to find exact command // Get the currently selected nodes information hTreeItem = TreeView_GetRoot(hTreeView); // Get the handle of the currently NodeStruct.hItem = hTreeItem; // Retrieve information regarding this item NodeStruct.mask = TVIF_TEXT | TVIF_PARAM; // The text and lParam attributes are valid NodeStruct.pszText = Name; // Pointer to the variable to hold the retrieved name NodeStruct.cchTextMax = MAX_NAME; SendDlgItemMessage(hWnd, IDC_SR_TREE, TVM_GETITEM, 0, (LPARAM) (LPTVITEMEX) &NodeStruct); // Get the info // perform some checking on this node and repeat. |
|
#2
|
|||
|
|||
|
It's been a while but...
It's been a few years since I had classes designing tree structures (I tried to design an AVL balanced binary tree with threads but failed), but since no one else has posted I can give it a whack with more information.
Is it a b-tree, a binary tree, or something else? And is it threaded, balanced, both, or neither? -Carl |
|
#3
|
|||
|
|||
|
Its simply a constructed treeview with items added.
The item level can be either ROOT_NODE GROUP_NODE MACRO_NODE COMMAND_NODE it should be pretty straight forward but i cant grasp it |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Recursive function pls help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|