Click here to Skip to main content
15,890,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Stack Overflow - Urgent Pin
CPallini16-Dec-07 22:22
mveCPallini16-Dec-07 22:22 
GeneralRe: Stack Overflow - Urgent Pin
Matthew Faithfull16-Dec-07 23:08
Matthew Faithfull16-Dec-07 23:08 
QuestionHow to use iLBC codec Pin
programmer8116-Dec-07 22:09
programmer8116-Dec-07 22:09 
Questionmfc dialog application problem Pin
zengkun10016-Dec-07 21:58
zengkun10016-Dec-07 21:58 
GeneralRe: mfc dialog application problem Pin
CPallini16-Dec-07 22:12
mveCPallini16-Dec-07 22:12 
GeneralRe: mfc dialog application problem Pin
pierre_ribery16-Dec-07 22:37
pierre_ribery16-Dec-07 22:37 
GeneralWhy? Pin
CPallini16-Dec-07 22:47
mveCPallini16-Dec-07 22:47 
GeneralRe: Why? Pin
pierre_ribery16-Dec-07 22:58
pierre_ribery16-Dec-07 22:58 
Because you are not guaranteed that the WM_TIMER message will be handled. THe dialog might be closed before the timer elapses (lets say 200-300ms). If you post a user defined message in OnInitDialog you are guaranteed that it will be handled before any messages sent after this! the timer might be invoked too late.

From MSDN: The WM_TIMER message is a low-priority message. The GetMessage and PeekMessage functions post this message only when no other higher-priority messages are in the thread's message queue.

also, you have to remember to kill the timer as the first thing in the WM_TIMER handler.

Another point is that it uses significantly more system resources to simply post a message. Why create a timer which will post a message, when you can directly post the message? Timers are limited system resources.

Might be more reasons, but it boils down to what is the best approach. The timer approach is a possibility, but not the BEST.
GeneralRe: Why? [modified] Pin
CPallini16-Dec-07 23:04
mveCPallini16-Dec-07 23:04 
GeneralRe: Why? Pin
pierre_ribery16-Dec-07 23:08
pierre_ribery16-Dec-07 23:08 
GeneralRe: Why? Pin
CPallini16-Dec-07 23:17
mveCPallini16-Dec-07 23:17 
GeneralRe: Why? Pin
pierre_ribery16-Dec-07 23:29
pierre_ribery16-Dec-07 23:29 
GeneralRe: Why? Pin
CPallini16-Dec-07 23:34
mveCPallini16-Dec-07 23:34 
GeneralRe: Why? Pin
pierre_ribery16-Dec-07 23:37
pierre_ribery16-Dec-07 23:37 
JokeRe: Why? Pin
CPallini17-Dec-07 0:00
mveCPallini17-Dec-07 0:00 
GeneralRe: mfc dialog application problem Pin
zengkun10016-Dec-07 23:06
zengkun10016-Dec-07 23:06 
GeneralRe: mfc dialog application problem Pin
Nelek16-Dec-07 22:41
protectorNelek16-Dec-07 22:41 
GeneralRe: mfc dialog application problem Pin
zengkun10016-Dec-07 23:14
zengkun10016-Dec-07 23:14 
QuestionCode to detect clicking the minimize icon? Pin
fantasy121516-Dec-07 21:40
fantasy121516-Dec-07 21:40 
GeneralRe: Code to detect clicking the minimize icon? Pin
Naveen16-Dec-07 22:04
Naveen16-Dec-07 22:04 
GeneralMSDN const_cast sample Pin
George_George16-Dec-07 21:34
George_George16-Dec-07 21:34 
GeneralRe: MSDN const_cast sample Pin
CPallini16-Dec-07 22:05
mveCPallini16-Dec-07 22:05 
GeneralRe: MSDN const_cast sample Pin
George_George16-Dec-07 22:28
George_George16-Dec-07 22:28 
GeneralRe: MSDN const_cast sample Pin
CPallini16-Dec-07 22:40
mveCPallini16-Dec-07 22:40 
GeneralRe: MSDN const_cast sample Pin
toxcct16-Dec-07 22:49
toxcct16-Dec-07 22:49 

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.