Sorry, 1 more question on this subject..


Why to be sorry? That's what the list is for, more questions. I'm sad when I look and there's no discussion going on.

An example:
My main dialog thread has pulled a message from the queue, and called the message function.
Within the function it is busy (not for long), and doesnt pull messages from the message queue.

right.

In the meantime within the IOCP thread, a PostMessage() is called to the main dialog thread who is busy, does this message still get called?

The PostMessage( ) isn't "called to the main dialog thread", it's called to post a message to the main dialog thread's queue. Subtle but a world of difference. And I think therin lies the key.


I take it that it will just be pending until the messages again are removed from the message queue again?

The message that was PostMessage( )ed to the queue will sit in the queue until the dialog thread pulls it off. And that will happen after your message function returns.


I just want to make sure that the message will still be carrried out.

It will.

The alternative is to call SendMessage( ) which is basically a PostMessage( ) that waits for the thread to actually carry out the message and send back the result. I don't recommend SendMessage( ) in your case and rarely at all. Sometimes SendMessage( ) can really mess things up because dispatching the message across threads and waiting for the result can cause lockups (imagine two threads that are both SendMessage( )ing each other waiting on the other's result), and IIIRC thread context on MFC objects can also step all over itself when you do it to. I've never had to use it and don't recommend it.

/dev


_______________________________________________ msvc mailing list [email protected] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.

Reply via email to