How to run a function every minute?
-
Dear All, I am working on my project (in MFC) which require me to run certain function every minute...I would like to know how I can do so except using a loop to check if the time is reached. I would prefer a "signal and slot" like method as there are some other functions need to run so I can use loop method to do so :((~_~ Thanks~
-
pliiiiiiiiiiiiiiiiizz read the MSDN before asking such questions !!!! OnTimer() of course !!!!! :doh::eek: X|
TOXCCT >>> GEII power
thats okey toxcct they shld check codeproject b4 msdn. tats our aim...:-D
greatest thing is to do wot others think you cant
suhredayan@omniquad.commessenger :suhredayan@hotmail.com
-
pliiiiiiiiiiiiiiiiizz read the MSDN before asking such questions !!!! OnTimer() of course !!!!! :doh::eek: X|
TOXCCT >>> GEII power
Yes. this is should be the first choice, even before MSDN. Rather microsoft should trigger it with F1.:laugh::laugh::laugh:
-
Dear All, I am working on my project (in MFC) which require me to run certain function every minute...I would like to know how I can do so except using a loop to check if the time is reached. I would prefer a "signal and slot" like method as there are some other functions need to run so I can use loop method to do so :((~_~ Thanks~
USE THIS #define ID_timer 1000 use add window handler to deliver window message WM_TIMER OnTimer SetTimer(ID_timer,1000*60,NULL); to end timer KillTimer(ID_timer); Alok Gupta visit me at http://alok.stormpages.com
-
Yes. this is should be the first choice, even before MSDN. Rather microsoft should trigger it with F1.:laugh::laugh::laugh:
Thats sounds nice, to have F1 shortcut to codeproject.;)
greatest thing is to do wot others think you cant
suhredayan@omniquad.commessenger :suhredayan@hotmail.com
-
USE THIS #define ID_timer 1000 use add window handler to deliver window message WM_TIMER OnTimer SetTimer(ID_timer,1000*60,NULL); to end timer KillTimer(ID_timer); Alok Gupta visit me at http://alok.stormpages.com
hey Mr Alok, you mustn't call KillTimer() otherwise the timer associated function will be call once whereas it has to call and call each 60 second indefinitely... besides that, you post repeats the ones ever posted, thank you very much ! Has somebody told here, let us sleep :zzz::zzz::zzz:
TOXCCT >>> GEII power
-
hey Mr Alok, you mustn't call KillTimer() otherwise the timer associated function will be call once whereas it has to call and call each 60 second indefinitely... besides that, you post repeats the ones ever posted, thank you very much ! Has somebody told here, let us sleep :zzz::zzz::zzz:
TOXCCT >>> GEII power
What are you saying? When a timer is no longer needed, of course
KillTimer()
should be called. Even though a fewWM_TIMER
messages may still be in the queue, the message-handling function can react accordingly.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
What are you saying? When a timer is no longer needed, of course
KillTimer()
should be called. Even though a fewWM_TIMER
messages may still be in the queue, the message-handling function can react accordingly.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
Thats sounds nice, to have F1 shortcut to codeproject.;)
greatest thing is to do wot others think you cant
suhredayan@omniquad.commessenger :suhredayan@hotmail.com
-
yes, but Alok seems to calls
KillTimer()
at the end ofOnTimer()
:( Maybe i'm wrong, but that's not clear...
TOXCCT >>> GEII power
toxcct wrote: Maybe i'm wrong, but that's not clear... While he could have highlighted the code and text better so that they did not appear to be one, I think he was just showing how to start a timer, and then how to stop a timer.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
USE THIS #define ID_timer 1000 use add window handler to deliver window message WM_TIMER OnTimer SetTimer(ID_timer,1000*60,NULL); to end timer KillTimer(ID_timer); Alok Gupta visit me at http://alok.stormpages.com
-
toxcct wrote: Maybe i'm wrong, but that's not clear... While he could have highlighted the code and text better so that they did not appear to be one, I think he was just showing how to start a timer, and then how to stop a timer.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
you are right buddy i am showing how to start a one minute timer and stop it to help him/her to understand problem:) Alok Gupta visit me at http://alok.stormpages.com