CRITICAL_SECTION hang my application

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Good Day, dear wine users :) .
I am the developer of program, which must work under Wine and Windows.  it has two threads, and these threads use one function 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;
InitializeCriticalSection(&cr_sec);



to initialize Critical Section.







[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux