Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Timers in MFC

Timers in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++tutorialquestion
6 Posts 5 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BoudewijnEctor
    wrote on last edited by
    #1

    Hi, I need to build some kind of app which, display a picture and after 10 seconds the next, etc...... To do that, I'll need some kind of timer conrol (like the Timer in .NET), is there something like that in MFC. If there is (I thinks there is), can somebody tell me how to use it? Thanks

    N M T B 4 Replies Last reply
    0
    • B BoudewijnEctor

      Hi, I need to build some kind of app which, display a picture and after 10 seconds the next, etc...... To do that, I'll need some kind of timer conrol (like the Timer in .NET), is there something like that in MFC. If there is (I thinks there is), can somebody tell me how to use it? Thanks

      N Offline
      N Offline
      NewHSKid
      wrote on last edited by
      #2

      There is a sleep function that you can use. I just use it as a puase between command, so if i think you want to use it for the same purpose it would be ok. Maybe you can display the first pic, then sleep, then remove the first pic and display the second pic? Sleep(time) btw, time is in milliseconds. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

      M 1 Reply Last reply
      0
      • B BoudewijnEctor

        Hi, I need to build some kind of app which, display a picture and after 10 seconds the next, etc...... To do that, I'll need some kind of timer conrol (like the Timer in .NET), is there something like that in MFC. If there is (I thinks there is), can somebody tell me how to use it? Thanks

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        Look up SetTimer() and KillTimer() --Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber CP SearchBar v2.0.2 released

        1 Reply Last reply
        0
        • B BoudewijnEctor

          Hi, I need to build some kind of app which, display a picture and after 10 seconds the next, etc...... To do that, I'll need some kind of timer conrol (like the Timer in .NET), is there something like that in MFC. If there is (I thinks there is), can somebody tell me how to use it? Thanks

          T Offline
          T Offline
          Ted Ferenc
          wrote on last edited by
          #4

          CreateWaitableTimer() and SetWaitableTimer() can also be used


          "Committee--a group of men who individually can do nothing but as a group decide that nothing can be done." - Fred Allen

          1 Reply Last reply
          0
          • N NewHSKid

            There is a sleep function that you can use. I just use it as a puase between command, so if i think you want to use it for the same purpose it would be ok. Maybe you can display the first pic, then sleep, then remove the first pic and display the second pic? Sleep(time) btw, time is in milliseconds. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

            M Offline
            M Offline
            Mike Dimmick
            wrote on last edited by
            #5

            Sleep is a blocking call. No Windows messages can be processed while your thread is blocked. This means that the rest of the user interface will be very unresponsive. If you don't need the timer to be very accurate, use SetTimer to have Windows send you a message when a timer expires.

            1 Reply Last reply
            0
            • B BoudewijnEctor

              Hi, I need to build some kind of app which, display a picture and after 10 seconds the next, etc...... To do that, I'll need some kind of timer conrol (like the Timer in .NET), is there something like that in MFC. If there is (I thinks there is), can somebody tell me how to use it? Thanks

              B Offline
              B Offline
              BoudewijnEctor
              wrote on last edited by
              #6

              Thanks you everybody; after reading your hints, I finally succeeded in building this part of the app! ;P:-D;):)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups