Re: Basic questions about queue timers

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks for pulling me in the right direction. Queue timer is exactly
what I need. Now it seems clear and I got this little test code
working exactly as expected. My main problem is that I had my
elapsed time in the 'period' parameter instead of the 'duetime'
parameter, and I needed to set period to 0.

I'm still not sure how to pass my own parameters thru the callback
function but I guess that's for another topic.


BOOL success;
DWORD dueTime;
// queue the timer
dueTime=1000;
success = ::CreateTimerQueueTimer(&m_timerHandle, NULL, TimerProc,
this, dueTime, 0, WT_EXECUTEONLYONCE);
dueTime=1500;
success = ::CreateTimerQueueTimer(&m_timerHandle, NULL, TimerProc,
this, dueTime, 0, WT_EXECUTEONLYONCE);
dueTime=2000;
success = ::CreateTimerQueueTimer(&m_timerHandle, NULL, TimerProc,
this, dueTime, 0, WT_EXECUTEONLYONCE);
dueTime=3000;
success = ::CreateTimerQueueTimer(&m_timerHandle, NULL, TimerProc,
this, dueTime, 0, WT_EXECUTEONLYONCE);

.