CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Posts
    61

    Help me with SetTimer function

    Hi,
    I need your help. I just like use SetTimer but
    I don't understand what must I include like 3th parameter in SetTimer. I'd like to set timer on in MDI application in Main Frame before opening any views
    Thank you in advance!
    Drago


  2. #2
    Join Date
    May 1999
    Location
    UK
    Posts
    65

    Re: Help me with SetTimer function

    I tend to cheat and use SetTimer like this.

    First define a UINT in your class to hold the timer value.

    i.e.

    class myclass : public CDialog
    {
    UINT m_nTimer;

    ....

    }

    Now somewhere in your code, InitDialog or what ever use:-

    m_nTimer = SetTime(1,1000,NULL)

    Add a WM_TIMER message using class wizard and poulate it with some code. i.e.

    void myclass::OnTimer(UINT nIDEvent)
    {
    static char buff[80];

    // Check to see if event was triggered by your timer.
    // i.e. Can start several timers
    if(nIDEvent==m_nTimer)
    {
    // Do your stuff
    }
    return TRUE;
    }

    I hope this helps.
    Jason.
    http://www.netcomuk.co.uk/~jbrooks


  3. #3
    Join Date
    May 1999
    Location
    Atlanta, GA, USA
    Posts
    443

    Re: 3rd parameter shows your callback function.

    Hi.

    If you want to use your callback funtion, you can put the function name at the 3rd parameter.

    HTH.
    -Masaaki Onishi-


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