Click here to Skip to main content
15,905,068 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Guarding delete Pin
Le centriste1-Mar-02 5:02
Le centriste1-Mar-02 5:02 
GeneralRe: Guarding delete Pin
Joe Moldovan1-Mar-02 11:56
Joe Moldovan1-Mar-02 11:56 
GeneralRe: Guarding delete Pin
Mukkie1-Mar-02 12:06
Mukkie1-Mar-02 12:06 
GeneralTimers are as threads? (newbie) Pin
Joan M28-Feb-02 22:18
professionalJoan M28-Feb-02 22:18 
GeneralRe: Timers are as threads? (newbie) Pin
Joaquín M López Muñoz28-Feb-02 23:41
Joaquín M López Muñoz28-Feb-02 23:41 
GeneralRe: Timers are as threads? (newbie) Pin
Steen Krogsgaard1-Mar-02 3:34
Steen Krogsgaard1-Mar-02 3:34 
GeneralRe: Timers are as threads? (newbie) Pin
Joan M1-Mar-02 4:54
professionalJoan M1-Mar-02 4:54 
GeneralRe: Timers are as threads? (newbie) Pin
Bill Wilson1-Mar-02 6:09
Bill Wilson1-Mar-02 6:09 
In a single threaded app, the only difference it makes is in the order that the code is executed.

somecode
SendMessage(somewhere...
Somemore code

Some more code, as you know, does not execute until the message has been processed.

somecode
PostMessage(somewhere...
Somemore code

In this case Somemore code will execute immediately, while the message sits in a queue.

If your main program doesn't run out of things to do (e.g. go to an idle state), the message handlers will never execute.

e.g.

void doit(
{
while (true)
{
somecode
PostMessage(somewhere...
Somemore code
}
}
in this case the message will never be handled.

versus something like


void doit()
{
somecode
PostMessage(somewhere...
Somemore code
}

in this case the message may be handled (depending on what other messages are already in the queue) immeidately after the doit procedure ends.

Therefore, SendMessage lets the sender control WHEN the message is processed, while PostMessage leaves it up to the vagueries of your message handler.

Hope this helps,
Bill

Thanks for the help,
Bill
GeneralRe: Timers are as threads? (newbie) Pin
Steen Krogsgaard3-Mar-02 21:30
Steen Krogsgaard3-Mar-02 21:30 
QuestionHow to access network shared resource from a service? Pin
28-Feb-02 21:21
suss28-Feb-02 21:21 
AnswerRe: How to access network shared resource from a service? Pin
Bill Wilson1-Mar-02 6:20
Bill Wilson1-Mar-02 6:20 
GeneralStandard Conversions about char Pin
28-Feb-02 19:38
suss28-Feb-02 19:38 
GeneralRe: Standard Conversions about char Pin
Joaquín M López Muñoz28-Feb-02 20:12
Joaquín M López Muñoz28-Feb-02 20:12 
GeneralRe: Standard Conversions about char Pin
Bill Wilson1-Mar-02 8:43
Bill Wilson1-Mar-02 8:43 
GeneralRe: Standard Conversions about char Pin
Tim Smith1-Mar-02 5:27
Tim Smith1-Mar-02 5:27 
GeneralPreventing a Non-resizable form from maximizing when run from a shortcut Pin
outlaw-torn28-Feb-02 19:05
outlaw-torn28-Feb-02 19:05 
GeneralRe: Preventing a Non-resizable form from maximizing when run from a shortcut Pin
Paul M Watt28-Feb-02 19:07
mentorPaul M Watt28-Feb-02 19:07 
GeneralRe: Preventing a Non-resizable form from maximizing when run from a shortcut Pin
Steen Krogsgaard1-Mar-02 3:37
Steen Krogsgaard1-Mar-02 3:37 
GeneralCustom message handling Pin
alex.barylski28-Feb-02 18:40
alex.barylski28-Feb-02 18:40 
GeneralRe: Custom message handling Pin
Mazdak28-Feb-02 18:47
Mazdak28-Feb-02 18:47 
GeneralRe: Custom message handling Pin
Nish Nishant28-Feb-02 19:25
sitebuilderNish Nishant28-Feb-02 19:25 
GeneralRe: Custom message handling Pin
alex.barylski28-Feb-02 19:55
alex.barylski28-Feb-02 19:55 
GeneralRe: Custom message handling Pin
Michael Dunn28-Feb-02 20:52
sitebuilderMichael Dunn28-Feb-02 20:52 
GeneralRe: Custom message handling Pin
alex.barylski1-Mar-02 6:02
alex.barylski1-Mar-02 6:02 
GeneralRe: Custom message handling Pin
alex.barylski1-Mar-02 6:15
alex.barylski1-Mar-02 6:15 

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.