|
-
February 1st, 2006, 02:16 PM
#1
clistctrl threadsafe access
I have clist control in my CListView based class. I also defined a function AddMsg to add item to the clist control. This function will be called from many places (threads) in the problem. I wan to have a threadsafe access to the control. I tried to use CCriticalSection for it, but the program will lock up, I think some deadlock is happening. How can I solve it.
CCriticalSection m_CriticalSection;
void CMyView::AddMsg(CString &msg)
{
m_CriticalSection.Lock();
do list control access...
m_CriticalSection.Unlock();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|