Click here to Skip to main content
16,006,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multi-threading problem Pin
John M. Drescher24-Nov-03 6:30
John M. Drescher24-Nov-03 6:30 
GeneralRe: Multi-threading problem Pin
John M. Drescher24-Nov-03 7:04
John M. Drescher24-Nov-03 7:04 
Generalterminating thread in button on-event Pin
jason9924-Nov-03 4:54
jason9924-Nov-03 4:54 
GeneralRe: terminating thread in button on-event Pin
David Crow24-Nov-03 5:15
David Crow24-Nov-03 5:15 
GeneralRe: terminating thread in button on-event Pin
jason9924-Nov-03 5:25
jason9924-Nov-03 5:25 
GeneralRe: terminating thread in button on-event Pin
David Crow24-Nov-03 5:46
David Crow24-Nov-03 5:46 
GeneralRe: terminating thread in button on-event Pin
valikac24-Nov-03 5:41
valikac24-Nov-03 5:41 
GeneralRe: terminating thread in button on-event Pin
Mike Dimmick24-Nov-03 5:49
Mike Dimmick24-Nov-03 5:49 
Aha!

m_cstaAnyStatic.SetWindowText causes a WM_SETTEXT message to be sent to the message queue. However, while in the loop in CAnyDlg::Stop, the UI thread can't process the message (this assumes that the static control and the dialog box were created by the same thread and hence share that thread's message queue).

You're effectively deadlocked.

It's typically a bad idea to directly modify any controls on the UI thread from a worker thread. It's better to define a custom message and post (not send) messages to the window to effect any changes in UI state. PostMessage just queues up the message, then returns; SendMessage blocks until the message is received by the window procedure, processed, and a response generated (either by returning from the window procedure, or by calling ReplyMessage).
GeneralRe: terminating thread in button on-event Pin
David Crow24-Nov-03 5:52
David Crow24-Nov-03 5:52 
GeneralRe: terminating thread in button on-event Pin
Anonymous24-Nov-03 6:54
Anonymous24-Nov-03 6:54 
Generaldoubts with ShellExecuteEx Pin
chadell24-Nov-03 4:37
chadell24-Nov-03 4:37 
GeneralRe: doubts with ShellExecuteEx Pin
David Crow24-Nov-03 5:00
David Crow24-Nov-03 5:00 
GeneralRe: doubts with ShellExecuteEx Pin
chadell24-Nov-03 20:32
chadell24-Nov-03 20:32 
GeneralRe: doubts with ShellExecuteEx Pin
valikac24-Nov-03 5:43
valikac24-Nov-03 5:43 
GeneralC++/VB Memory Allocation Pin
Anton A. Loukine24-Nov-03 4:17
Anton A. Loukine24-Nov-03 4:17 
GeneralRe: C++/VB Memory Allocation Pin
Anton A. Loukine24-Nov-03 4:36
Anton A. Loukine24-Nov-03 4:36 
GeneralRe: C++/VB Memory Allocation Pin
JWood24-Nov-03 4:51
JWood24-Nov-03 4:51 
GeneralRe: C++/VB Memory Allocation Pin
Anton A. Loukine24-Nov-03 4:54
Anton A. Loukine24-Nov-03 4:54 
GeneralRe: C++/VB Memory Allocation Pin
David Crow24-Nov-03 4:57
David Crow24-Nov-03 4:57 
GeneralRe: C++/VB Memory Allocation Pin
Anton A. Loukine24-Nov-03 5:06
Anton A. Loukine24-Nov-03 5:06 
GeneralRe: C++/VB Memory Allocation Pin
David Crow24-Nov-03 5:18
David Crow24-Nov-03 5:18 
GeneralRe: C++/VB Memory Allocation Pin
David Crow24-Nov-03 4:55
David Crow24-Nov-03 4:55 
GeneralRe: C++/VB Memory Allocation Pin
Anton A. Loukine24-Nov-03 5:02
Anton A. Loukine24-Nov-03 5:02 
GeneralRe: C++/VB Memory Allocation Pin
David Crow24-Nov-03 5:27
David Crow24-Nov-03 5:27 
GeneralRe: C++/VB Memory Allocation Pin
Anton A. Loukine24-Nov-03 5:49
Anton A. Loukine24-Nov-03 5:49 

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.