VC中的定时器(对应于VB中的timer)是什么控件或对应于什么类?找了半天没找到,cai呀!!

解决方案 »

  1.   

    The SetTimer function creates a timer with the specified time-out value. UINT SetTimer(
      HWND hWnd,              // handle of window for timer messages
      UINT nIDEvent,          // timer identifier
      UINT uElapse,           // time-out value
      TIMERPROC lpTimerFunc   // address of timer procedure
    );
    VC中的定时器没有对应的控件。 
      

  2.   

    没有对应的控件,用
    SetTimer(...)
    在ontimer里处理
    KillTimer(...)
      

  3.   

    Example// This example shows how to use CWnd::SetTimer, CWnd::KillTimer, and how to handle WM_TIMER messages. A timer is set up to send a WM_TIMER message to the main frame window every 2 seconds in OnStartTimer(). OnStopTimer will stop the timer by calling CWnd::KillTimer. OnTimer was set up through class wizard to handle WM_TIMER messages for the main frame window.  In this example the PC speaker will beep every 2 seconds.void CMainFrame::OnStartTimer() 
    {
       m_nTimer = SetTimer(1, 2000, 0);
    }void CMainFrame::OnStopTimer() 
    {
       KillTimer(m_nTimer);   
    }void CMainFrame::OnTimer(UINT nIDEvent) 
    {
       MessageBeep(0xFFFFFFFF);   // Beep   // Call base class handler.
       CMDIFrameWnd::OnTimer(nIDEvent);
    }
      

  4.   

    用msdn查一下SetTimer()和KillTimer()两个函数