![]() |
| ||
| MFC Countdown Timer I am writing a MFC application and need to have the program pause for a few seconds. I am trying to use the OnTimer event and am having troubles. The following code causes the program to freeze and stop responding m_iCount = 0; However if I add the following it works fine. m_iCount = 0; In both of these examples the program is suppose to wait 5 seconds before continuing. Also note that m_iCount is suppose to incrament everytime the ID_TEST_TIMER event is called. Any suggestions on what I am doing wrong and can do to fix it? |
| ||
| Re: MFC Countdown Timer while(m_iCount <= 5)How many ways can you say infinite loop ? and it is consuming nearly all CPU time? why are you making it so difficult ? If you goal is for the program to pause for 5 second, just call Sleep() function. No need for that timer. |
| ||
| Re: MFC Countdown Timer Why? Becasue I am a noob who forgot about Sleep(); Thanx for the help!!:o |
| ||
| Re: MFC Countdown Timer Ok, so here's a spin off of the previous. If I wanted the user to only have say 20 seconds to enter text in an edit box before it grayed out, how would I go about that? Sleep()causes the program to pause, so what would I use? |
| ||
| Re: MFC Countdown Timer Why don't you read the documentation for Sleep() ???? |
| ||
| Re: MFC Countdown Timer Quote:
|
| All times are GMT -4. The time now is 12:39 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC