×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    252

    sample code or link to implement ctimer

    Hi all,

    can anyone give me a sample code or link to implement ctimer in a class.


    Thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: sample code or link to implement ctimer

    CTimer is a partially implemented active object. As its documentation says, you should inherit a class from CTimer, implement RunL and you are ready. Probably.

  3. #3
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    252

    Re: sample code or link to implement ctimer

    Quote Originally Posted by wizard_hu_ View Post
    CTimer is a partially implemented active object. As its documentation says, you should inherit a class from CTimer, implement RunL and you are ready. Probably.
    Thanks for ur reply . Is it really necessary to derve a class from it.

    Cann't we take it as a member variable and use it.

    Thanks

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: sample code or link to implement ctimer

    Hi deepakk,

    It may sound weird but could you tell how to start a new thread in forum and for sample implementation you could follow this link
    http://wiki.forum.nokia.com/index.php/Timers
    Regards,
    Sriky

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: sample code or link to implement ctimer

    No, that is CPeriodic what you can use as a member variable (if you have any S60 1st or 2nd edition SDK-s S[eries]60Ex\Graphics uses CPeriodic - if you do not have such SDK-s, Scalable Screen Drawing example is something similar, from www.forum.nokia.com, Documentation/Symbian C++ on the left, Graphics).

  6. #6
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    252

    Re: sample code or link to implement ctimer

    Hello wizard ,

    sorry i am not so good at c++ but want to know why we can't use it as a member variable. beacuse i have implemented cperiodic as a member variable. and cperiodic is derived from cTimer. I can't found out the reason. Can u please explain.

    Hello sriky thanks for ur response but i have already gone through it.

    Thanks

  7. #7
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: sample code or link to implement ctimer

    Deepak how to create a new thread in discussion like you have a created for sample code or link to implement ctimer Ok I give up I don't intend to do it in this thread but I couldnt find a link to create a new thread or I have forgotten how to do it.

    Wizard,

    Congratulations on the completion of 9000 posts and counting.
    Regards,
    Sriky

  8. #8
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: sample code or link to implement ctimer

    Quote Originally Posted by sriky27 View Post
    how to create a new thread in discussion like you have a created for sample code or link to implement ctimer
    You would find "NEW THREAD" on each section of discussion boards. Click on it and ask your questions.

    Let's say this section: http://discussion.forum.nokia.com/fo...splay.php?f=40

    Developer Discussion Boards >> Programming Languages >> Symbian C++ >> General Symbian C++

    Find out "NEW THREAD" button after above line in above link.
    Nokia Developer Wiki Moderation team

  9. #9
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    252

    Re: sample code or link to implement ctimer

    Waiting for reply to my query.....

    any sugestion ......


    Thanks

  10. #10
    Super Contributor
    Join Date
    May 2003
    Location
    Vancouver, Canada
    Posts
    985

    Re: sample code or link to implement ctimer

    Quote Originally Posted by deepakk View Post
    sorry i am not so good at c++ but want to know why we can't use it as a member variable. beacuse i have implemented cperiodic as a member variable. and cperiodic is derived from cTimer. I can't found out the reason. Can u please explain.
    Here is why:

    - You cannot use CTimer as member variable because when the timer is outstanding, CTimer::RunL() will be called. Now, how can you handle this event if you use is as member variable? You need to derive your class from CTimer and then override RunL().

    - For CPeriodic, the case is different. When you activate timer using CPeriodic::Start(), you specify the callback function that will be called when the timer is outstanding. That's why you just handle the event from the callback.

    Hope this helps.
    Antony Pranata
    http://www.antonypranata.com/
    http://www.s60tips.com/

  11. #11
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: sample code or link to implement ctimer

    Hey thanks kiran I was looking for that thread so that I can congratulation wizard_hu I just saw the 9000 post coming but you see I lost the chance.
    Regards,
    Sriky

Similar Threads

  1. [newbie here] Link error
    By xitpu in forum Symbian
    Replies: 3
    Last Post: 2007-01-24, 16:53
  2. Need sample code!
    By r.sharafi in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2006-08-27, 19:15
  3. Sample code for MMS
    By yanxiang in forum General Messaging
    Replies: 4
    Last Post: 2004-12-07, 02:00
  4. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29
  5. MMS sample code???
    By Nokia_Archive in forum General Messaging
    Replies: 1
    Last Post: 2002-05-23, 15:51

Posting Permissions

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