Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » tree grid and worker thread Collapse All
Subject Author Date
Rado Manzela Nov 27, 2010 - 3:37 PM

I know I cannot paint from worker thread, but is it safe just to iterate over tree nodes and read data from cells? Calling ItemGetRoot() and other functions asserts in debug mode. I need to run some processing in timer which reads tree structure and it can take few seconds, it is not nice to hang whole application in "random" intervals when user is probably scrolling the list or doing anything else with application. Is it necessary to lock tree modification (adding/removing nodes) from UI thread when worker thread is iterating the tree? (ItemGetNext, etc.).
Thank you.

Technical Support Nov 29, 2010 - 4:01 AM

Object maps in MFC are not cross-thread. I.e. the ASSERT_VALID( pObject ) should be invoked only in the same thread where the pObject object is instantiated. This means Prof-UIS classes should be used in the main UI thread only. I.e. you should use UI controls only for visualizing data.