Click here to Skip to main content
16,005,080 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Catching dynamically created CStatic windows messages Pin
Fernando A. Gomez F.7-Jul-06 5:12
Fernando A. Gomez F.7-Jul-06 5:12 
GeneralRe: Catching dynamically created CStatic windows messages Pin
Gary R. Wheeler7-Jul-06 11:59
Gary R. Wheeler7-Jul-06 11:59 
AnswerRe: Catching dynamically created CStatic windows messages Pin
Hamid_RT6-Jul-06 19:22
Hamid_RT6-Jul-06 19:22 
GeneralRe: Catching dynamically created CStatic windows messages Pin
Fernando A. Gomez F.7-Jul-06 5:14
Fernando A. Gomez F.7-Jul-06 5:14 
QuestionOwner drawn button matrix Pin
cshell496-Jul-06 13:33
cshell496-Jul-06 13:33 
AnswerRe: Owner drawn button matrix Pin
Justin Tay6-Jul-06 21:54
Justin Tay6-Jul-06 21:54 
QuestionMultithread Prime Directive Compliance [modified] Pin
quasinormalized6-Jul-06 12:22
quasinormalized6-Jul-06 12:22 
AnswerRe: Multithread Prime Directive Compliance Pin
Gary R. Wheeler6-Jul-06 14:52
Gary R. Wheeler6-Jul-06 14:52 
In your CMyDlg::OnBnClicked handler, you're calling WaitForSingleObject(hEventWorkDone_, INFINITE);. This blocks the UI thread, which keeps it from handling messages, which keeps it from updating the screen (and a whole lot of other things).

Blocking the message pump Is A Bad Thing, and yes, you have violated the Windows prime directive: Thou Shalt Process Messages If Thee Wishes Thine UI To Behave Properly.

As a rule, a better approach to communication between a worker thread and a window (e.g. the UI thread) is to have the worker thread use PostMessage to send user-defined messages to the window.




Software Zen: delete this;
GeneralRe: Multithread Prime Directive Compliance Pin
Ryan Binns6-Jul-06 19:20
Ryan Binns6-Jul-06 19:20 
GeneralRe: Multithread Prime Directive Compliance Pin
quasinormalized7-Jul-06 4:58
quasinormalized7-Jul-06 4:58 
QuestionProblem with alphablending Pin
Luksky6-Jul-06 11:17
Luksky6-Jul-06 11:17 
AnswerRe: Problem with alphablending Pin
Hamid_RT6-Jul-06 19:20
Hamid_RT6-Jul-06 19:20 
QuestionWhy do we need heap allocation? [modified] Pin
sawerr6-Jul-06 11:07
sawerr6-Jul-06 11:07 
AnswerRe: Why do we need heap allocation? Pin
Chris Losinger6-Jul-06 11:25
professionalChris Losinger6-Jul-06 11:25 
GeneralRe: Why do we need heap allocation? Pin
sawerr6-Jul-06 11:44
sawerr6-Jul-06 11:44 
GeneralRe: Why do we need heap allocation? [modified] Pin
Chris Losinger6-Jul-06 12:07
professionalChris Losinger6-Jul-06 12:07 
GeneralRe: Why do we need heap allocation? Pin
sawerr6-Jul-06 12:30
sawerr6-Jul-06 12:30 
GeneralRe: Why do we need heap allocation? Pin
Chris Losinger6-Jul-06 15:24
professionalChris Losinger6-Jul-06 15:24 
QuestionClass exported from a DLL Pin
Jay036-Jul-06 10:55
Jay036-Jul-06 10:55 
AnswerRe: Class exported from a DLL Pin
led mike6-Jul-06 11:15
led mike6-Jul-06 11:15 
GeneralRe: Class exported from a DLL Pin
Jay036-Jul-06 11:41
Jay036-Jul-06 11:41 
QuestionLooking for a C++ programmer Pin
roland516-Jul-06 10:31
roland516-Jul-06 10:31 
AnswerRe: Looking for a C++ programmer Pin
led mike6-Jul-06 10:49
led mike6-Jul-06 10:49 
GeneralRe: Looking for a C++ programmer Pin
ThatsAlok6-Jul-06 18:45
ThatsAlok6-Jul-06 18:45 
AnswerRe: Looking for a C++ programmer Pin
peterchen6-Jul-06 10:54
peterchen6-Jul-06 10:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.