>  I have a couple of threads created with socket IOCP. Is it safe to post a
message
>within the thread? I occasionally got an error , which I think codewarrior
point it to a
>::SendMessage(..) command within my thread. I changed the ::SendMessage(..)
to
>::PostMessage(..) and seams to be fine. Can it be that SendMessage() waits
until
>the Send routine is complete, and Post message posts the message in returns
>immediately? I have a handle to the main dialog box in which I use in the
first
>parameter of PostMessage.

Yes, SendMessage() waits for a response from the message handler, whereas
PostMessage returns immediately. Just be careful with any data passed
through PostMessage() as pointers, though, since it needs to still exist
even when PostMessage() returns - otherwise when the handler comes to
process it, the pointer would point to no-man's land and you'd be in
trouble.

--
Jason Teagle
[EMAIL PROTECTED]



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

Reply via email to