Is TreeContol Thread Safe?
-
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
-
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
If you are using MFC, the objects are not thread-safe at the object level, only at the class level.
-
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
If you use
SendMessage
orPostMessage
the control is thread-safe, because Windows guarantees that message handling is thread-safe. The MFC objects that wrap controls (likeCTreeCtrl
) do not work across thread boundaries.
Software Zen:
delete this;