Results 1 to 4 of 4

Thread: Timer

  1. #1

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Exclamation

    I have a question..does anyone know how to make a timer in C++? Could someone tell me the code, please? thanks! This isnt a windows app...it's dos with a windows message box in it. I am using Dev-C++ and i dont know what compiler. Dev-C++ is a free builder. It's at www.bloodshed.net. So, does anyone have a code for a non-windows app.?
    Last edited by SomethinCool; Apr 21st, 2001 at 11:28 PM.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It's quite difficult to make a timer if you're unable to use the Windows service functions like SetTimer and KillTimer. What compiler are you using?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    If you are making windows app.

    Code:
    #include <windows.h>
    
    const ID_TIME = 15;
    SetTimer(hDlg,ID_TIME,1,NULL);
    
    case WM_TIMER:
    //code
    break;
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  4. #4
    Megatron
    Guest
    If you want, you could also have a separate procedure for the timer, by specifying the procedure in the last argument.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width