Timers in Console Applications
I'm having trouble figuring out how to create and use a timer in
Windows when you don't want to build an actual windowed application,
but rather are making a console app. All examples I've found so tie
timers directly into the windows.
For Example:
[url]http://msdn2.microsoft.com/en-us/library/microsoft.win32.systemevents.createtimer(VS.80).aspx[/url]
Any suggestions?
PS I am NOT using dot net
Re: Timers in Console Applications
Dave wrote:[color=blue]
> I'm having trouble figuring out how to create and use a timer in
> Windows when you don't want to build an actual windowed application,
> but rather are making a console app. All examples I've found so tie
> timers directly into the windows.[/color]
For timers that do not need a window you can use CreateWaitableTimer,
Sleep, or timeSetEvent, or WaitForMultipleObjects with a timeout. But
since you don't have a message queue you have to invent your own system
for figuring out how to integrate the timer notification with your
application code.
--
Scott McPhillips [VC++ MVP]