Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 20 Jun 2006 03:16 PM by  pbergman
Using Multimedia timer
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages
pbergman
New Member
New Member
Posts:


--
20 Jun 2006 03:16 PM
    I have some problems using the multimedia timer.
    The call to timeSetEvent returns an identifier to the timer, but the callback function is never called.
    The same code seems to work well if you run it on a PC.

    Any help would be greatly appreciated.

    /per

    void CMMTimerDemoDlg::OnButtonStartTimer()
    {
    // check the timer's capabilities
    TIMECAPS timeCaps;
    if ( timeGetDevCaps(&timeCaps, sizeof(timeCaps)) !=TIMERR_NOERROR){
    AfxMessageBox(_T("Failed to get capabilities."));
    return;
    }

    // set the period of the timer
    m_uiPeriod = timeCaps.wPeriodMin;
    if ( timeBeginPeriod(m_uiPeriod) != TIMERR_NOERROR) {
    AfxMessageBox(_T("Failed to Begin Period."));
    return;
    }

    // start the timer
    m_uiTimer = timeSetEvent(
    1000, // delay in ms
    m_uiPeriod, // resolution
    TimerProcedure, // callback procdure
    NULL, // user data
    TIME_PERIODIC); //
    if (m_uiTimer == 0){
    AfxMessageBox(_T("Failed to start timer."));
    return;
    }
    }
    You are not authorized to post a reply.