Click here to Skip to main content
15,900,511 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: having problem with User defined message. Pin
David Crow8-Aug-07 5:39
David Crow8-Aug-07 5:39 
AnswerRe: having problem with User defined message. Pin
alberthyc8-Aug-07 5:49
alberthyc8-Aug-07 5:49 
GeneralRe: having problem with User defined message. Pin
David Crow8-Aug-07 6:03
David Crow8-Aug-07 6:03 
GeneralRe: having problem with User defined message. Pin
alberthyc8-Aug-07 7:58
alberthyc8-Aug-07 7:58 
QuestionRe: having problem with User defined message. Pin
David Crow8-Aug-07 8:02
David Crow8-Aug-07 8:02 
AnswerRe: having problem with User defined message. Pin
alberthyc8-Aug-07 8:04
alberthyc8-Aug-07 8:04 
GeneralRe: having problem with User defined message. Pin
David Crow8-Aug-07 8:14
David Crow8-Aug-07 8:14 
GeneralRe: having problem with User defined message. Pin
alberthyc8-Aug-07 8:18
alberthyc8-Aug-07 8:18 
http://www.flounder.com/workerthreads.htm[^]

in the "Worker threads and the GUI II: Don't touch the GUI" section , it mentioned something:
"In my case, the list box sent a notification, via SendMessage, to its parent. This means the message went to its parent thread. But the parent thread was blocked, waiting for the thread to complete. But the thread couldn't complete until it could run, and guess what: the SendMessage was a cross-thread SendMessage, which would not return until it was processed. But the only thread that could process it was blocked, and couldn't run until the thread completed. Welcome to the world of deadlock."
and
"The FindWindow problem was quite similar. The programmer had specified finding a window with a particular caption. This meant that the thread running FindWindow had to SendMessage a WM_GETTEXT message to the window whose handle it had just found via EnumWindows. This message could not be processed until the thread that owned the window could execute. But it couldn't, because it was blocked waiting for the thread to finish. Deadlock. So note that although you should not touch the GUI thread explicitly, you must also not touch it implicitly, through such innocuous-seeming operations such as FindWindow, or you can, and will, experience deadlock. Under these conditions, by the way, there is no recovery. You can kill the process, which explicitly terminates all threads, but this is neither elegant nor, as the warning box tells us, necessarily safe"

i'm wondering that if i send a message to the dialog box, which is the parent thread supposedly, isn't that the samething as mentioned above?
Maybe i'm misunderstanding...
GeneralRe: having problem with User defined message. Pin
David Crow8-Aug-07 8:26
David Crow8-Aug-07 8:26 
GeneralRe: having problem with User defined message. Pin
alberthyc8-Aug-07 8:32
alberthyc8-Aug-07 8:32 
GeneralRe: having problem with User defined message. Pin
David Crow8-Aug-07 8:38
David Crow8-Aug-07 8:38 
GeneralRe: having problem with User defined message. Pin
JudyL_MD8-Aug-07 8:44
JudyL_MD8-Aug-07 8:44 
GeneralRe: having problem with User defined message. Pin
Mark Salsbery8-Aug-07 8:26
Mark Salsbery8-Aug-07 8:26 
GeneralRe: having problem with User defined message. Pin
alberthyc8-Aug-07 8:34
alberthyc8-Aug-07 8:34 
GeneralRe: having problem with User defined message. Pin
Mark Salsbery8-Aug-07 8:41
Mark Salsbery8-Aug-07 8:41 
GeneralRe: having problem with User defined message. Pin
alberthyc8-Aug-07 10:25
alberthyc8-Aug-07 10:25 
QuestionFitting text in window Pin
William Engberts8-Aug-07 5:16
William Engberts8-Aug-07 5:16 
AnswerRe: Fitting text in window Pin
daveyerwin8-Aug-07 6:43
daveyerwin8-Aug-07 6:43 
Questioncalling Excel application from c++ Pin
jyothim8-Aug-07 4:51
jyothim8-Aug-07 4:51 
AnswerRe: calling Excel application from c++ Pin
jk chan8-Aug-07 17:43
jk chan8-Aug-07 17:43 
Questioncalling Excel application from c++ Pin
jyothim8-Aug-07 4:46
jyothim8-Aug-07 4:46 
AnswerRe: calling Excel application from c++ Pin
William Engberts8-Aug-07 5:10
William Engberts8-Aug-07 5:10 
GeneralRe: calling Excel application from c++ Pin
jyothim8-Aug-07 5:40
jyothim8-Aug-07 5:40 
GeneralRe: calling Excel application from c++ Pin
led mike8-Aug-07 7:17
led mike8-Aug-07 7:17 
AnswerRe: calling Excel application from c++ Pin
Russell'8-Aug-07 7:42
Russell'8-Aug-07 7:42 

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.