validity of HTREEITEM
-
I've a tree with many items and subitems; any item has an unique itemdata value. Sometimes I need to find the item that has a certain itemdata value. Actually I start by the ROOT item and I check every item and subitem looking for their itemdata values. The items I look for are usually few and I look for them very often, so I thought to use a CMAp for caching the last searches I did. The only problem is to know if the HTREEITEM I found in the map is still valid. Any idea?
-
I've a tree with many items and subitems; any item has an unique itemdata value. Sometimes I need to find the item that has a certain itemdata value. Actually I start by the ROOT item and I check every item and subitem looking for their itemdata values. The items I look for are usually few and I look for them very often, so I thought to use a CMAp for caching the last searches I did. The only problem is to know if the HTREEITEM I found in the map is still valid. Any idea?
You could call GetItem() with your HTREEITEM value in the TVITEM structure. If it returns TRUE - your item is valid. Get trial copy of comment generating tool CommentMakerPro, std::string and std::string containers viewer FeinEvaluatorPro and windows manager for Microsoft Visual Studio .NET FeinWindows at www.FeinSoftware.com
-
I've a tree with many items and subitems; any item has an unique itemdata value. Sometimes I need to find the item that has a certain itemdata value. Actually I start by the ROOT item and I check every item and subitem looking for their itemdata values. The items I look for are usually few and I look for them very often, so I thought to use a CMAp for caching the last searches I did. The only problem is to know if the HTREEITEM I found in the map is still valid. Any idea?
Does the tree change frequently? The HTREEITEM is valid until the item is deleted or the tree destroyed. if the tree changes ferquently, you might be better off with separating the data (in some STL-built container maybe) from a "tree renderer".
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen -
Does the tree change frequently? The HTREEITEM is valid until the item is deleted or the tree destroyed. if the tree changes ferquently, you might be better off with separating the data (in some STL-built container maybe) from a "tree renderer".
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygenIt represents some data stored in a DB; there are folders and subfolders. When the DB changes I need to update the corresponding tree item, so I must find it :) The three change frequently, also because the item may be deleted and cretated in another folder, so the cached data maybe obsolete. I think that GetItem is OK, thanks vladfein. Paolo