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. ATL / WTL / STL
  4. How to add Timer in activex ?

How to add Timer in activex ?

Scheduled Pinned Locked Moved ATL / WTL / STL
comtutorialquestion
3 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.
  • A Offline
    A Offline
    alan top
    wrote on last edited by
    #1

    I code this, but no use? why? How to add Timer in activex ? BEGIN_MSG_MAP(ClistSample) MESSAGE_HANDLER(WM_TIMER, OnTimer) END_MSG_MAP() LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { return 0; } alantop

    K P 2 Replies Last reply
    0
    • A alan top

      I code this, but no use? why? How to add Timer in activex ? BEGIN_MSG_MAP(ClistSample) MESSAGE_HANDLER(WM_TIMER, OnTimer) END_MSG_MAP() LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { return 0; } alantop

      K Offline
      K Offline
      khan
      wrote on last edited by
      #2

      I believe you will need a Window to get timer messages. It doesn't work in window-less controls. 1- You could use the Multimedia timer. 2- Or you could just create a hidden window that would receive the timer messages. 3- Or create a thread that sleeps for the specified amount of time, and calls a function of your program. (quite inaccurate timing). this is this.

      1 Reply Last reply
      0
      • A alan top

        I code this, but no use? why? How to add Timer in activex ? BEGIN_MSG_MAP(ClistSample) MESSAGE_HANDLER(WM_TIMER, OnTimer) END_MSG_MAP() LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { return 0; } alantop

        P Offline
        P Offline
        Pharago
        wrote on last edited by
        #3

        You need to start the timer. UINT nMilliseconds = 1000; ::SetTimer(hWnd,ID_TIMER,nMilliseconds,NULL); when finish stop it with ::KillTimer(hWnd,ID_TIMER);

        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