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. HTREEITEM lifetime

HTREEITEM lifetime

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
3 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.
  • M Offline
    M Offline
    Martyn Pearson
    wrote on last edited by
    #1

    Basically, when you insert an item into a tree, you do something along the lines of HTREEITEM hMyItem = pMyTree->InsertItem(&lvTreeItem); Is it ever possible that the value of hMyItem will change throughout the lifetime of the tree? My reason for asking is that I have an object for each item in the tree, and I would like to maintain the handle within the object so that changes to it can be reflected easily in the tree (i.e. by changing the icon etc) Thanks in advance!

    H M 2 Replies Last reply
    0
    • M Martyn Pearson

      Basically, when you insert an item into a tree, you do something along the lines of HTREEITEM hMyItem = pMyTree->InsertItem(&lvTreeItem); Is it ever possible that the value of hMyItem will change throughout the lifetime of the tree? My reason for asking is that I have an object for each item in the tree, and I would like to maintain the handle within the object so that changes to it can be reflected easily in the tree (i.e. by changing the icon etc) Thanks in advance!

      H Offline
      H Offline
      HENDRIK R
      wrote on last edited by
      #2

      Martyn Pearson wrote: Is it ever possible that the value of hMyItem will change throughout the lifetime of the tree? As far as I know a handle to a tree item should be valid during whole lifetime of the tree. I can't guess any situation in which the handle could be changed - especially as you can use it on any time for further operations like deleting, ...

      1 Reply Last reply
      0
      • M Martyn Pearson

        Basically, when you insert an item into a tree, you do something along the lines of HTREEITEM hMyItem = pMyTree->InsertItem(&lvTreeItem); Is it ever possible that the value of hMyItem will change throughout the lifetime of the tree? My reason for asking is that I have an object for each item in the tree, and I would like to maintain the handle within the object so that changes to it can be reflected easily in the tree (i.e. by changing the icon etc) Thanks in advance!

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        Martyn Pearson wrote: Is it ever possible that the value of hMyItem will change throughout the lifetime of the tree? No, if that happened then HTREEITEMs would be useless. --Mike-- Looks like I picked the wrong week to stop sniffing glue. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

        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