![Avatar of prema75](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
prema75
asked on
Timer Function
Hi,
I want to use SetTimer Function in a win32 console application. I got the code compiled and build without error. I used like this.. But it is not calling the TimerFunct function. Can you please send me sample code to user SetTimer function in win32 console application.. Thank you.. //SPrema.
CODE:
SetTimer(NULL,1, 10000,TimerFunct);
callback Function:
__stdcall TimerFunct()
{
printf("Timerfunc");
return 0;
}
I want to use SetTimer Function in a win32 console application. I got the code compiled and build without error. I used like this.. But it is not calling the TimerFunct function. Can you please send me sample code to user SetTimer function in win32 console application.. Thank you.. //SPrema.
CODE:
SetTimer(NULL,1, 10000,TimerFunct);
callback Function:
__stdcall TimerFunct()
{
printf("Timerfunc");
return 0;
}
![Avatar of sunj](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
I guess SetTimer doesn't work with console application at all...
![Avatar of mikeblas](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
> I guess SetTimer doesn't work with console application at all...
That's not correct. SetTimer() works fine in console applications. You need to have a message pump, though. Prema, does your console app have a message pump in the thread where you're expecting the timer to work?
..B ekiM
That's not correct. SetTimer() works fine in console applications. You need to have a message pump, though. Prema, does your console app have a message pump in the thread where you're expecting the timer to work?
..B ekiM
![Avatar of mmg](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
perhaps you need to create a thread for it!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.