×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Nov 2004
    Location
    California, USA
    Posts
    121

    Question No don't close my daemon or getting SetSystem to work for non-UI daemon

    Hello,

    I want a program which is notified when a media card is removed. I have based my class on the nokia forum wiki
    http://wiki.forum.nokia.com/index.ph...removal_events

    It is important to set the app's system attribute to prevent it from being closed. With a s60 app, this will work:

    CEikonEnv::Static()->SetSystem( ETrue );

    For my purposes I need a background process which will be restart when the phone reboots(ie, no UI). The wiki recommends...

    iWg = new (ELeave) RWindowGroup( iWs );
    User::LeaveIfError( iWg->Construct( (TUint32)iWg, EFalse ) );

    iWg->SetOrdinalPosition( -1 );
    iWg->EnableReceiptOfFocus( EFalse );

    iWgName = CApaWindowGroupName::NewL( iWs );
    iWgName->SetSystem( ETrue );
    iWgName->SetHidden( ETrue );
    iWgName->SetWindowGroupName( *iWg );


    Notice we are using iWgName->SetSystem(ETrue). This is of type CApaWindowGroupName. Unfortunately, when the card is removed the daemon program is closed. Do you know how I can make the daemon behave like the s60 app?

    Thanks for your time and consideration.

    Sincerely,

    John

  2. #2
    Regular Contributor
    Join Date
    Nov 2004
    Location
    California, USA
    Posts
    121

    Re: No don't close my daemon or getting SetSystem to work for non-UI daemon

    Hello,

    Symbian has a faq addressing SetSystem().
    http://www.symbian.com/developer/tec.../faq_0908.html

    This makes me thing the code presented above should work.

    -John

  3. #3
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: No don't close my daemon or getting SetSystem to work for non-UI daemon

    Except that the FAQ is talking about GUI applications.

    Have a look at User::SetCritical and TCritical.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  4. #4
    Regular Contributor
    Join Date
    Nov 2004
    Location
    California, USA
    Posts
    121

    Re: No don't close my daemon or getting SetSystem to work for non-UI daemon

    Hello,

    Thanks, valid point the Symbian FAQ does assume it is an Application.

    Here is a different post where someone said they got CEikonEnv::SetSytem() to work with a "non-GUI application"
    https://developer.symbian.com/forum/...ageID=57513
    I'm interpreting that to be a symbian console application. I'll try that next.

    Also, the wiki explicit recommends using the CApaWindowGroupName::SetSystem() for this purpose.

    Initially, User::SetCritical() sounds attractive until you see the capability required and more importantly the consequence of the program going away(i.e., entire system is rebooted. ouch!)

    -John

  5. #5
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: No don't close my daemon or getting SetSystem to work for non-UI daemon

    You did enable extended panic codes to make sure this is not a coding error?
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

Posting Permissions

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