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. TimerQueueTimers..A question..

TimerQueueTimers..A question..

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
3 Posts 2 Posters 0 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.
  • M Offline
    M Offline
    montiee
    wrote on last edited by
    #1

    I'm using the timerqueuetimers that MFC provides in my app. No problems at the moment with them but I do have one puzzling question I can't answer. With TimerQueueTimers you are allowed to supply context or user specified data as a parameter which can be used when the callback gets invoked. Now if I want to stop the timer (ie delete it) I call DeleteTimerQueueTimer(). All well and good but how do I delete any user data I've attached as a parameter when I created the timer? The documentation says nothing. Does it automatically delete the parameter? Appreciate any input.

    M 1 Reply Last reply
    0
    • M montiee

      I'm using the timerqueuetimers that MFC provides in my app. No problems at the moment with them but I do have one puzzling question I can't answer. With TimerQueueTimers you are allowed to supply context or user specified data as a parameter which can be used when the callback gets invoked. Now if I want to stop the timer (ie delete it) I call DeleteTimerQueueTimer(). All well and good but how do I delete any user data I've attached as a parameter when I created the timer? The documentation says nothing. Does it automatically delete the parameter? Appreciate any input.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      jbem wrote:

      the timerqueuetimers that MFC provides

      That's Win32 :)

      jbem wrote:

      Does it automatically delete the parameter?

      No! You are responsible for cleaning up any resources associated with the user param if necessary.

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      M 1 Reply Last reply
      0
      • M Mark Salsbery

        jbem wrote:

        the timerqueuetimers that MFC provides

        That's Win32 :)

        jbem wrote:

        Does it automatically delete the parameter?

        No! You are responsible for cleaning up any resources associated with the user param if necessary.

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        M Offline
        M Offline
        montiee
        wrote on last edited by
        #3

        Mark Salsbery wrote: No! You are responsible for cleaning up any resources associated with the user param if necessary. That's what I feared. So how does one delete the parameter one supplied at timer creation. Surely we don't have to keep track of a map that maps handles to parameters to delete?! I'd be interested in hearing a confirmation that I need to keep track of it all myself but in the meantime I'll start making the changes to keep track of it because I have a feeling that's the way it's headed. It's be nice if the documentation mentioned these things..

        modified on Monday, September 1, 2008 3:29 PM

        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