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. problem with overriding "OnIdle" method of WinApp

problem with overriding "OnIdle" method of WinApp

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 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.
  • B Offline
    B Offline
    Banks K
    wrote on last edited by
    #1

    Hello All, I am overriding "virtual BOOL OnIdle(LONG lCount );" method in my application. i think it should execute befor application start mean after initinstance and also at the idle time but it is not executing in my application. can any one tell me what i have to do for override this method. please share your knowledge. thanks bankey

    M 1 Reply Last reply
    0
    • B Banks K

      Hello All, I am overriding "virtual BOOL OnIdle(LONG lCount );" method in my application. i think it should execute befor application start mean after initinstance and also at the idle time but it is not executing in my application. can any one tell me what i have to do for override this method. please share your knowledge. thanks bankey

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

      Your OnIdle never gets called? Have you seen this? OnIdle Member Function[^] Mark

      Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."

      B 1 Reply Last reply
      0
      • M Mark Salsbery

        Your OnIdle never gets called? Have you seen this? OnIdle Member Function[^] Mark

        Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."

        B Offline
        B Offline
        Banks K
        wrote on last edited by
        #3

        Hello, now i read that document also but i am still unable to gets called "onIdle" method can you tell what i have to do for that. also i have another application in which, onIdle method gets called at the time of start application and end application i also i want that please tell me where i am wrong......

        M 1 Reply Last reply
        0
        • B Banks K

          Hello, now i read that document also but i am still unable to gets called "onIdle" method can you tell what i have to do for that. also i have another application in which, onIdle method gets called at the time of start application and end application i also i want that please tell me where i am wrong......

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

          If your OnIdle() override isn't getting called then I'd guess that your app is dialog based and your main dialog is modal. In that case, you need to use the undocumented WM_KICKIDLE message:

          // Add to the dialog .h file:

          afx_msg LRESULT OnKickIdle(WPARAM wp, LPARAM lp);

          // Add to the dialog .cpp file:

          #include <afxpriv.h> //Private MFC header - defines WM_KICKIDLE

          // Add to the dialog's message map
          ON_MESSAGE(WM_KICKIDLE,&CMyMainDlg::OnKickIdle)

          LRESULT CMyMainDlg::OnKickIdle(WPARAM wParam, LPARAM lParam)
          {
          // do your idle processing here

          return 0;
          }

          Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."

          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