Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. validity of HTREEITEM

validity of HTREEITEM

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paolo Vernazza
    wrote on last edited by
    #1

    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?

    V P 2 Replies Last reply
    0
    • P Paolo Vernazza

      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?

      V Offline
      V Offline
      vladfein
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • P Paolo Vernazza

        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?

        P Offline
        P Offline
        peterchen
        wrote on last edited by
        #3

        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

        P 1 Reply Last reply
        0
        • P peterchen

          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

          P Offline
          P Offline
          Paolo Vernazza
          wrote on last edited by
          #4

          It 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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups