CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: SetTimer

  1. #1
    Join Date
    May 1999
    Location
    Sweden
    Posts
    55

    SetTimer

    Hi,

    I need to use the timer but I´m not sure exactly how to use it. I´m want to
    use the GetDuration-function of the Windows mediaplayer to be displayed in
    static textfield. It returns a double.

    I thougth that I only had to use the SetTimer-function to
    SetTimer(1,1000,NULL). and then in the OnTimer function catch it. like this:

    void CMMediaDlg::OnTimer(UINT nIDEvent)
    {
    if(nIDEvent==1)
    {
    CString str = (CString)mpDlg.m_MediaPlayer.GetDuration();
    m_Duration.SetWindowText(str);
    }
    CDialog::OnTimer(nIDEvent);
    }

    What am I doing wrong? And is there any other way to convert a double into a
    string? My guess is that the conversion isn´t done right. Please help me

    Frederik.




  2. #2
    Join Date
    May 1999
    Location
    Serbia, YUgoslavia
    Posts
    9

    Re: SetTimer

    CString str;
    str.Format( "%f", mpDlg.m_MediaPlayer.GetDuration());


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured