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 General Discussion » How to use a CExtTreeCtrl in Working Thread(Prof-UIS 2.88) Collapse All
Subject Author Date
park ki tae Mar 26, 2010 - 7:52 PM

 


  


 I want to use CExtTreeCtrl Class in Working Thread. 


 but i can’t !


for example when i’m going to change treeitem color in worktread, i must use this  function (  "TreeItemInfoGet( hitem ).m_clrTextNormal = color" )


but program is crashed because ot the ASSERT_VALID(this).


Is  It Impossible to use CExtTreeCtrl in workthread?


please let me know. thanks


 CExtTreeCtrl::TREEITEMINFO_t * CExtTreeCtrl::TreeItemInfoGetPtr( HTREEITEM hti )

{

 ASSERT_VALID( this );

 if( hti == NULL )

 {

  ASSERT( false );

  ::AfxThrowUserException();

 }

TREEITEMINFO_t * pTII = NULL;

 if( ! m_mapItemInfo.Lookup( hti, pTII ) )

  return NULL;

 ASSERT( pTII != NULL );

 return pTII;

}

Technical Support Mar 29, 2010 - 12:31 PM

All the themed by Prof-UIS paint manager controls are not multithread safe. The paint manager component is the compound component which draws all the parts of all the themed UI elements. The paint manager caches many GDI objects. The GDI library is not multithreaded. As result, the paint manager and all the themed Prof-UIS controls, including the CExtTreeCtrl control, are not multithreaded. Please create all the UI elements of your app in the main UI thread and make your worker threads performing their heavy work in the background and without explicit UI access. All the well-known Microsoft’s applications are based on this single threaded UI design.