Click here to Skip to main content
15,889,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCDWordArray and sort Pin
pranavamhari12-Jan-04 16:00
pranavamhari12-Jan-04 16:00 
GeneralRe: CDWordArray and sort Pin
bryce12-Jan-04 17:52
bryce12-Jan-04 17:52 
GeneralRe: CDWordArray and sort Pin
pranavamhari12-Jan-04 20:20
pranavamhari12-Jan-04 20:20 
GeneralRe: CDWordArray and sort Pin
l a u r e n12-Jan-04 21:23
l a u r e n12-Jan-04 21:23 
GeneralRe: CDWordArray and sort Pin
jhwurmbach12-Jan-04 22:19
jhwurmbach12-Jan-04 22:19 
GeneralRe: CDWordArray and sort Pin
bryce13-Jan-04 0:31
bryce13-Jan-04 0:31 
QuestionPostThreadMessage(...)??? Pin
zhaopzhi12-Jan-04 15:48
zhaopzhi12-Jan-04 15:48 
AnswerRe: PostThreadMessage(...)??? Pin
Antti Keskinen12-Jan-04 18:34
Antti Keskinen12-Jan-04 18:34 
Where is the WM_TEST message supposed to go ? Which thread does threadID designate ? Are you certain that this ID is correct ?

The message boxes are, by default, application modal. This means that the message pump handling of the application will pause for during the showing of the message box. In sequence 1, the results of posting the message WM_TEXT are visible only after you close the message box. In sequence 2, they MIGHT BE visible already during the showing of the box.

I say, might be, as PostThreadMessage returns before the message itself is handled. In sequence 2, the message is posted to the thread's queue, but if this thread is the same as which is to show the message box, then it might be that the message will not be handled before the message box is closed.

So, if threadID points to the same thread as which is to pop up the message box, then the thread's queue will be suspended until the closing of the box. You should never pop up modal message boxed in these type of situations. Use SendMessage to post a message to the thread's main window and wait for the window procedure to handle it. In this case, the application would either first show the message box, then handle the message, or vice versa.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralMultilingual (Unicode) Pin
12-Jan-04 14:25
suss12-Jan-04 14:25 
GeneralNeed help with sending email through program. Pin
Snyp12-Jan-04 14:19
Snyp12-Jan-04 14:19 
GeneralRe: Need help with sending email through program. Pin
bryce12-Jan-04 15:51
bryce12-Jan-04 15:51 
GeneralRe: Need help with sending email through program. Pin
Snyp12-Jan-04 16:02
Snyp12-Jan-04 16:02 
GeneralRe: Need help with sending email through program. Pin
bryce12-Jan-04 16:14
bryce12-Jan-04 16:14 
GeneralRe: Need help with sending email through program. Pin
murali_utr12-Jan-04 17:35
murali_utr12-Jan-04 17:35 
GeneralRe: Need help with sending email through program. Pin
Marcello16-Jan-04 7:30
Marcello16-Jan-04 7:30 
Generalhelppp!!! ERROR_ACCESS_DENIED and openprocesstoken() Pin
dp512-Jan-04 12:58
dp512-Jan-04 12:58 
GeneralCancel button on Modeless dialog Pin
Spank me!!12-Jan-04 11:54
Spank me!!12-Jan-04 11:54 
GeneralRe: Cancel button on Modeless dialog Pin
mhar12-Jan-04 14:28
professionalmhar12-Jan-04 14:28 
GeneralRe: Cancel button on Modeless dialog Pin
jhwurmbach12-Jan-04 22:28
jhwurmbach12-Jan-04 22:28 
GeneralBlank Taskbar Icon in XP Pin
Michael Babb12-Jan-04 11:18
Michael Babb12-Jan-04 11:18 
GeneralWinsock2 help please! Pin
LizardWiz12-Jan-04 11:14
LizardWiz12-Jan-04 11:14 
GeneralRe: Winsock2 help please! Pin
Joaquín M López Muñoz12-Jan-04 11:33
Joaquín M López Muñoz12-Jan-04 11:33 
GeneralSMPT mail problem Pin
Anonymous12-Jan-04 10:42
Anonymous12-Jan-04 10:42 
GeneralRe: SMPT mail problem Pin
Joaquín M López Muñoz12-Jan-04 11:22
Joaquín M López Muñoz12-Jan-04 11:22 
GeneralRe: SMPT mail problem Pin
bryce12-Jan-04 16:45
bryce12-Jan-04 16:45 

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.