×

Discussion Board

Page 1 of 4 1234 LastLast
Results 1 to 15 of 55
  1. #1
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    How do implement an active object code for an example.

    Hi All,
    I am written an code inside UI class function :HandleCommandL(TInt aCommand)

    case ECommand1:



    int i=0,sum1=0;
    //CWindowGc& gc = SystemGc();

    for(;i<1000001;i++)
    sum1+=i;

    CTest6AppUi:: sum= sum1;
    iAppView->sum= sum1;
    //Test6AppView->
    break;
    case ECommand2:


    actually this code is doing nothing but just updating a view object variable sum1 as sum of 100000 integers.

    it execute when click on command 1 through menu every time.
    but get hanged for some time as click on menu option ECommand1if take one useless loop out side just for taking more time"for notifying") .
    is there any way to implement it using active object so that mean while active object calculate this value when clicking on command "ECommand1:" ???



    Please Help me.....

    Thanks in Advance,
    Rajesh

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How do implement an active object code for an example.

    You basically have three threads on this same problem already:
    http://discussion.forum.nokia.com/fo...ht=#post827892
    http://discussion.forum.nokia.com/fo...ht=#post828143
    http://discussion.forum.nokia.com/fo...ht=#post827833

    Thus maybe you should read what has been suggested, and try the suggestions out. Also what is the excat point of this applciation, i.e. what it is supposed to excatly do, and how ?

  3. #3
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    Re: How do implement an active object code for an example.

    Hi symbianyucca,

    I agree with your suggestion but thing is:

    I understand what a active scheduler do.
    it is just alternate of multi threading concept.
    but lack of multi processor in an mobile need execute sequentially and that is the concept of active object (Don't let wait to CPU until program is running).
    But the thing is that how it get implement in symbian OS I don't know and i am going through wicki documents but lots of things given there ..
    i am not able to figure out which code will be putted where as i am new to symbian OS programming.
    and also there must be some exact code by which get success for the same.
    but lots of confusion arise around me after reading these steps.
    I request the minimal code what and where i have to write so that this process works.
    Ans also this every thing is not from our side also depend how OS treat.
    Please help if you can.......

    Thanks in Advance,
    Rajesh

  4. #4
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: How do implement an active object code for an example.

    As I got now your problem is how to use active objects? so here are some details and example links are available.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  5. #5
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    Re: How do implement an active object code for an example.

    Hi Krish,

    Thanks!!!
    I am going through with the same...


    Thanks,
    Rajesh

  6. #6
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    Re: How do implement an active object code for an example.

    Hi All,

    I am getting error in given below code, when trying to inherit CActive class for sheduling some defined function.

    CTest6AppUi::CTest6AppUi()
    {

    //Error is: Cannot construct CTest6AppUi base class CActive.

    }
    As i have inherited CActive in UI class "CTest6AppUi ".
    I don't know why??
    Please help me ...

    Thanks in Advance,
    Rajesh

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How do implement an active object code for an example.

    You should make a new class, and derive it from CActive, I suppose you are just trying to add CActive to your Appui class..

  8. #8
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    Re: How do implement an active object code for an example.

    Yes Yucca,
    You are right..
    Thanks for replying...

    Thanks,
    Rajesh

  9. #9
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    Re: How do implement an active object code for an example.

    But Now getting error in below line in header file of view: i have derived a new class from CActive in side UI.h


    Class CTest6AppView : public CCoeControl \\Error: decleration syntax error


    I don't have any idea as very first time have to implement this code (using active object)

    Thanks,
    Rajesh

  10. #10
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    Re: How do implement an active object code for an example.

    Yucca,
    Please give me a hint how to start for the same.


    Thanks in advance,
    Rajesh

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,671

    Re: How do implement an active object code for an example.

    class should be lower case, that may be a reason.
    declaration syntax error often indicates some preceding error, my guess would be that the ; is missing at the end of the new CActive-stuff.
    (
    Code:
    class CYourActive : public CActive
    {
    ...
    };
    
    class CTest6AppView : public CCoeControl
    )

  12. #12
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    Re: How do implement an active object code for an example.

    Hi Wizard,

    Thanks A Lot!!!
    Really i was missing ";" after active class deceleration.....
    i was not getting as no such hint was coming in compilation.

    Thanks,
    rajesh

  13. #13
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    Re: How do implement an active object code for an example.

    Hi All,

    Can any one provide me a project(may be url) sample of an active object where it is being use?? so that i go through the code and it may help me.
    in symbian c++ third edition..
    Please help me.




    Thanks in Advance,
    Rajesh

  14. #14
    Registered User
    Join Date
    Oct 2008
    Location
    India
    Posts
    219

  15. #15
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    213

    Re: How do implement an active object code for an example.

    Hi Sunil,
    Thanks for Help.....

    do u have any ready made project example where any how active object is used? i have searched in side SDK(csrbide c++ what i have instaled currently
    ) but didn't get any such example.
    if yes ples mail me zip file at rajeshjnu06@gmail.com.
    if i have so then i can run it on carbide c++ and get the flow ..How it is working.

    Thanks in Advance,
    Rajesh

Similar Threads

  1. Active Object (CNwSignalCheck) into an Active Object (CPeriodic): is it possible?
    By KB24 in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2010-09-20, 16:57
  2. Replies: 2
    Last Post: 2007-11-17, 09:04
  3. Replies: 2
    Last Post: 2007-10-05, 20:40
  4. waiting for an active object
    By dalore in forum Symbian
    Replies: 3
    Last Post: 2003-06-19, 13:16
  5. How to unactivate an active object?
    By Marw_Work in forum Symbian
    Replies: 1
    Last Post: 2002-10-14, 16:03

Posting Permissions

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