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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. getting problem in ontimer(UINT nIDEvent)

getting problem in ontimer(UINT nIDEvent)

Scheduled Pinned Locked Moved C / C++ / MFC
help
8 Posts 3 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.
  • C Offline
    C Offline
    cancerion
    wrote on last edited by
    #1

    hi i want call OnTimer(UINT nIDEvent) in same class by using SetTimer(4444,5000,NULL); but i am unable to call ,it didn't go in OnTimer() body can anyone help me. thanks in advance sachin

    O 1 Reply Last reply
    0
    • C cancerion

      hi i want call OnTimer(UINT nIDEvent) in same class by using SetTimer(4444,5000,NULL); but i am unable to call ,it didn't go in OnTimer() body can anyone help me. thanks in advance sachin

      O Offline
      O Offline
      Owner drawn
      wrote on last edited by
      #2

      cancerion wrote:

      but i am unable to call

      There is no need to call OnTimer. It's called everytime a WM_TIMER event is fired. Did you add a message map entry for OnTimer. That is ON_WM_TIMER()

      Jesus Loves You and Me :)

      --Owner Drawn --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord

      C 1 Reply Last reply
      0
      • O Owner drawn

        cancerion wrote:

        but i am unable to call

        There is no need to call OnTimer. It's called everytime a WM_TIMER event is fired. Did you add a message map entry for OnTimer. That is ON_WM_TIMER()

        Jesus Loves You and Me :)

        --Owner Drawn --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord

        C Offline
        C Offline
        cancerion
        wrote on last edited by
        #3

        hi , i have tried this there is no change in situation , while i have one application uaing this function , i have followed that ,still i m unable to do that

        O 1 Reply Last reply
        0
        • C cancerion

          hi , i have tried this there is no change in situation , while i have one application uaing this function , i have followed that ,still i m unable to do that

          O Offline
          O Offline
          Owner drawn
          wrote on last edited by
          #4

          How is OnTimer declared

          Jesus Loves You and Me :)

          --Owner Drawn --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord

          C 1 Reply Last reply
          0
          • O Owner drawn

            How is OnTimer declared

            Jesus Loves You and Me :)

            --Owner Drawn --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord

            C Offline
            C Offline
            cancerion
            wrote on last edited by
            #5

            afx_msg void OnTimer(UINT nIDEvent);

            O 1 Reply Last reply
            0
            • C cancerion

              afx_msg void OnTimer(UINT nIDEvent);

              O Offline
              O Offline
              Owner drawn
              wrote on last edited by
              #6

              This how I do... BEGIN_MESSAGE_MAP(.......) ON_WM_TIMER() END_MESSAGE_MAP() afx_msg void OnTimer(UINT nIDEvent); SetTimer(timerID, delay, callback); //rest of the code void MyClassName::OnTimer(UINT nIDEvent) { ..... } well it will work if it done like this... Change the delay to 1000... So that you can check faster Try again

              Jesus Loves You and Me :)

              --Owner Drawn --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord

              C 1 Reply Last reply
              0
              • O Owner drawn

                This how I do... BEGIN_MESSAGE_MAP(.......) ON_WM_TIMER() END_MESSAGE_MAP() afx_msg void OnTimer(UINT nIDEvent); SetTimer(timerID, delay, callback); //rest of the code void MyClassName::OnTimer(UINT nIDEvent) { ..... } well it will work if it done like this... Change the delay to 1000... So that you can check faster Try again

                Jesus Loves You and Me :)

                --Owner Drawn --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord

                C Offline
                C Offline
                cancerion
                wrote on last edited by
                #7

                thanks, i think ,i have made a mistake in my main program . in which it's not working .i also made a program separately and it was working .so now i will make changes again in my main program thanks once again

                T 1 Reply Last reply
                0
                • C cancerion

                  thanks, i think ,i have made a mistake in my main program . in which it's not working .i also made a program separately and it was working .so now i will make changes again in my main program thanks once again

                  T Offline
                  T Offline
                  ThatsAlok
                  wrote on last edited by
                  #8

                  cancerion wrote:

                  .i also made a program separately and it was working .so now i will make changes again in my main program

                  Is your timer program have his own window!

                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                  cheers, Alok Gupta VC Forum Q&A :- I/ IV

                  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