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. Is TreeContol Thread Safe?

Is TreeContol Thread Safe?

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresjsonquestion
3 Posts 3 Posters 1 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.
  • O Offline
    O Offline
    orcun colak
    wrote on last edited by
    #1

    I have two threads that need to insert new items to the same tree control on win nt. If the windows tree control thread safe or should I synchronize the insert operation ? Actually it would be easier to ask it like this. Is ::InsertItem api that is used to insert new items thread safe ? Does windows synchronize the operation ? Thanks, Orcun Colak

    D G 2 Replies Last reply
    0
    • O orcun colak

      I have two threads that need to insert new items to the same tree control on win nt. If the windows tree control thread safe or should I synchronize the insert operation ? Actually it would be easier to ask it like this. Is ::InsertItem api that is used to insert new items thread safe ? Does windows synchronize the operation ? Thanks, Orcun Colak

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      If you are using MFC, the objects are not thread-safe at the object level, only at the class level.

      1 Reply Last reply
      0
      • O orcun colak

        I have two threads that need to insert new items to the same tree control on win nt. If the windows tree control thread safe or should I synchronize the insert operation ? Actually it would be easier to ask it like this. Is ::InsertItem api that is used to insert new items thread safe ? Does windows synchronize the operation ? Thanks, Orcun Colak

        G Offline
        G Offline
        Gary R Wheeler
        wrote on last edited by
        #3

        If you use SendMessage or PostMessage the control is thread-safe, because Windows guarantees that message handling is thread-safe. The MFC objects that wrap controls (like CTreeCtrl) do not work across thread boundaries.


        Software Zen: delete this;

        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