Thread Interruption
-
I write this 3D editor at http://marius.homeunix.org:8000 I've moved the compilation process in a thread. () The thread has to update the progress bar of the Dialog-Bar and the text in the static and report list box. I'm sending WM_* messages to these windows. Under Win2K work 100% OK but in Win 98 it hangs in the SendMessage (dead lock). Any Ideeas Thanks.
-
I write this 3D editor at http://marius.homeunix.org:8000 I've moved the compilation process in a thread. () The thread has to update the progress bar of the Dialog-Bar and the text in the static and report list box. I'm sending WM_* messages to these windows. Under Win2K work 100% OK but in Win 98 it hangs in the SendMessage (dead lock). Any Ideeas Thanks.
-
Did you try using PostMessage?... "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me
I have to send text to the static control TCHAR someOutString; _stprntf(someOutString,"Preogress is :%d%%",_percentage); dlgbar.m_static.SendMessage(WM_SETTEXT,0,(LPCTSTR)someOutString); If I do PostMessage I loose the LPARAM ... 'someOutString'. I have installed VC 6 under 98 and I I get hang in user.dll Thx
-
I have to send text to the static control TCHAR someOutString; _stprntf(someOutString,"Preogress is :%d%%",_percentage); dlgbar.m_static.SendMessage(WM_SETTEXT,0,(LPCTSTR)someOutString); If I do PostMessage I loose the LPARAM ... 'someOutString'. I have installed VC 6 under 98 and I I get hang in user.dll Thx
>> I have to send text to the static control << So what? You may have different options, e.g: 1. Put your TCHAR someOutString as global variable acessed by both threads; 2. Allocate yours someOutString on sending thread and free on receiving... >> I get hang in user.dll << The reason for hang could be limited message queue on Win98... Regards "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me
-
>> I have to send text to the static control << So what? You may have different options, e.g: 1. Put your TCHAR someOutString as global variable acessed by both threads; 2. Allocate yours someOutString on sending thread and free on receiving... >> I get hang in user.dll << The reason for hang could be limited message queue on Win98... Regards "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me
-
Opps... It works. I did it and It works fine. Thank you. Anyway I have overmessage there Now I SendMessage() 1-3/sec. and is OK. { static int modul = 0; if(modul++%64 == 0) { UpdateProgressBars() } } Thanks. Igor.
>> Anyway I have overmessage there << OK, that confirms that the reason for a deadlock is limited queue on Win98. Hope 3 seconds is fine, but it's still not be 100% bullet prooof. I don't see any solution other then PostMessage. With PostMessage also you can check on your sending thread that only one WM_SETTEXT is travelling and Post only if nothing is in queue. For example if your string is global and sending thread sets it and receiving empties it --> you will only PostMessage if that global string is empty... Regards "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me