Visual C++ 2008 elapsed timer
I need help creating an elapsed timer with visual C++ 2008. Basically what I want to do is have elapsed time in seconds, minutes and hours tick down on a 'label' control. I've gotten it all set up, including the code for starting the timer ( this->tim_main->Enabled = true; )
All I need now is someone experienced with VC++ to help me out.
Thanks in advance.
Wiki_Tiki
Junior Poster in Training
60 posts since Jul 2008
Reputation Points: 23
Solved Threads: 3
Thanks mike,
Any chance of giving the key syntaxes and snippets to help me out? I'm kind of a noob at C++.
Thanks
Wiki_Tiki
Junior Poster in Training
60 posts since Jul 2008
Reputation Points: 23
Solved Threads: 3
there was 1 error in the code:
error C2374: 'iCount' : redefinition; multiple initialization
(on the repeated line 'int iCount = Convert::ToInt32(this->lblCount->Text);'
I tried removing the line, and it counts down by two's.
However, If you remove the line at the top where it decrements (iCount--) it counts down properly. Thanks a lot, you were great help :)
Wiki_Tiki
Junior Poster in Training
60 posts since Jul 2008
Reputation Points: 23
Solved Threads: 3
Sorry, I just realised another problem. If the user were to enter text in three textboxes (Hours, Minutes and Seconds), and they were converted to int32's, how would it be programmed so that if the seconds reach 0, and there were still 13 minutes remaining, it would automatically restart from 59 seconds, taking away another minute?
Thanks in advance
Wiki_Tiki
Junior Poster in Training
60 posts since Jul 2008
Reputation Points: 23
Solved Threads: 3
You know, ur really quite amazing :) It works perfectly (lol yeah, i know, I'm retarded for not thinking of decrementing by second :P). And yes, I programmed it so if they enter hours higher than 24, A messageBox says, "You cannot enter hours higher than 24" and if you enter more than 59 mins, or 59 secs, etc.
Anyway, I added to ur reputation so thanks a ton.
Wiki_Tiki
Junior Poster in Training
60 posts since Jul 2008
Reputation Points: 23
Solved Threads: 3