Displaying 1 result from an estimated 1 matches for "h_edit".
Did you mean:
_edit
2010 Nov 20
1
CRITICAL_SECTION hang my application
...n to add text to Rich text box. When they try to add texts in parallel, a mixed text appear. So I decided to use critical section. When main thread tries to add text, the text adds perfectly, but when the second thread tries to add text - it hangs my app :( .
Here is the code in C++:
Code:
HWND__ *h_Edit = rtf_list->Handle;
EnterCriticalSection(&cr_sec);
CHARRANGE cr;
cr.cpMin = 0;
cr.cpMax = 0;
// App hangs on this line
SendMessage(h_Edit, EM_EXSETSEL, 0, (LPARAM)&cr);
//.....
LeaveCriticalSection(&cr_sec);
Before this I use:
Code:
CRITICAL_SECTION cr_sec;
InitializeCri...