×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Kiev, Ukraine
    Posts
    20

    Progress bars: what's wrong with my code?

    My code crashes emulator. I don't want to test this on a real device ;-)

    Here's the code, maybe someone can suggest?

    --- In my AppUi -----------------

    CAknProgressDialog* iProgressDialog;
    CEikProgressInfo* iProgressInfo;
    const TInt KFinalValue( 100 );

    iProgressDialog = new(ELeave)CAknProgressDialog( (REINTERPRET_CAST(CEikDialog**,&iProgressDialog)));

    iProgressDialog->PrepareLC(R_MY_PROGRESS_NOTE);
    iProgressDialog->SetTextL(_L("Test Progress"));
    iProgressDialog->RunLD();
    iProgressInfo = iProgressDialog->GetProgressInfoL();
    iProgressInfo->SetFinalValue( KFinalValue );
    ...
    iProgressInfo->IncrementAndDraw(10);
    ...
    iProgressDialog->ProcessFinishedL();
    -- end ----------------------

    -- In my .rss file -------------
    RESOURCE CBA r_my_softkeys_cancel
    {
    buttons =
    {
    CBA_BUTTON
    {
    txt = " ";
    },
    CBA_BUTTON
    {
    id = EAknSoftkeyCancel;
    txt = "Cancel";
    }
    };
    }

    RESOURCE DIALOG r_my_progress_note
    {
    flags = EAknProgressNoteFlags;
    buttons = r_my_softkeys_cancel;
    items =
    {
    DLG_LINE
    {
    type = EAknCtNote;
    id = EMyCtrlIdProgressNote;
    control = AVKON_NOTE
    {
    layout = EProgressLayout;
    singular_label = "Singular";
    plural_label = "Plural";
    };
    }
    };
    }
    -- end ----------------------

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    Kiev, Ukraine
    Posts
    20

    RE: Progress bars: what's wrong with my code?

    It looks like making iProgressDialog global solves this problem. Although I'd like to know why.

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    30
    You can't store this particular pointer on the stack

    The stack frame has vanished by the time the dialog gets deleted.

Posting Permissions

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