Timer2.TimerCallBack

Last post 05-16-2008 14:06 by ctacke. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-16-2008 6:37

    Timer2.TimerCallBack

    Dear All,

    Does anyone has an idea how to override TimerCallBack?

    I tried

    tmrWork.UseCallback = true;

    protected override void tmrWork.TimerCallback()

    {....

    }

    , seems that this cannot work??  I am using latest SDF 2.2.

     

  • 05-16-2008 8:19 In reply to

    • Neil
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-30-2007
    • North Wales
    • Posts 1,152

    Re: Timer2.TimerCallBack

    public class MyTimer : Timer2
    {
        public MyTimer(int interval) : base(interval) 
        {
            UseCallback = true;
        }
        
        public override void TimerCallback()
        {
            // TODO: Add your code here
        }
    }

  • 05-16-2008 14:06 In reply to

    • ctacke
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-27-2007
    • Indiana
    • Posts 1,939

    Re: Timer2.TimerCallBack

    Also keep in mind that the Timer2 class uses CE's multimedia timer functionality, which is not present in PPC/WinMo device images, so if you're trying this on one of those devices you'll likely get a MissingMethodException (future releases will throw a PlatformNotSupported exception when you try to create a Timer2 instance).

Page 1 of 1 (3 items)