×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    problema with CAknProgressDialog

    Hi,

    In my program I have a process more long, and I think to use a CAknProgressDialog.
    The code that I use is:

    void CSalvaLaCoppiaAppView::ShowProgressNoteUnderSingleProcessL( TInt aResourceId, TInt /* aControlId */)

    {
    // Delete possible previous CAknProgressDialog.
    delete iProgressDialog;

    // Create new CAknProgressDialog.
    iProgressDialog = new ( ELeave ) CAknProgressDialog( reinterpret_cast
    <CEikDialog**>
    ( &iProgressDialog ) );

    iProgressDialog->SetCallback( this );
    iProgressDialog->PrepareLC( aResourceId );
    iProgressInfo = iProgressDialog->GetProgressInfoL();
    iProgressInfo->SetFinalValue( KProgressbarFinalValue );
    iProgressDialog->RunLD();

    delete iIdle;

    iIdle = CIdle::NewL( CActive::EPriorityStandard );
    TCallBack callback( CallbackIncrementProgressNoteL, this );
    iIdle->Start( callback );
    }


    // -----------------------------------------------------------------------------
    // CSalvaLaCoppiaAppView::CallbackIncrementProgressNoteL()
    // Just call UpdateProgressNote() function.
    // If return 1(ETrue), CIdle calls this again.
    // If retrun 0(EFalse), CIdle does not call this.
    // -----------------------------------------------------------------------------
    //
    TInt CSalvaLaCoppiaAppView::CallbackIncrementProgressNoteL( TAny* aThis )
    {

    return static_cast<CSalvaLaCoppiaAppView*>( aThis )->UpdateProgressNote();
    }


    // -----------------------------------------------------------------------------
    // CSalvaLaCoppiaAppView::UpdateProgressNote()
    // Updates ProgressNote
    // -----------------------------------------------------------------------------
    //
    TInt CSalvaLaCoppiaAppView::UpdateProgressNote()
    {
    TTime intervalTime;
    intervalTime.HomeTime();
    intervalTime += TTimeIntervalMicroSeconds( 50000 );
    TTime currentTime;
    currentTime.HomeTime();

    while ( intervalTime > currentTime )
    {
    currentTime.HomeTime();
    }
    iProgressInfo->IncrementAndDraw( 1 );
    if ( KProgressbarFinalValue <= iProgressInfo->CurrentValue() )
    {
    iProgressDialog->ProcessFinishedL();
    delete iProgressDialog;
    iProgressDialog = NULL;
    return 0;
    }

    return 1;
    }


    // -----------------------------------------------------------------------------
    // CSalvaLaCoppiaAppView:ialogDismissedL()
    // Called when/if the dialog has been dismissed.
    // iIdle must be canceled when cancel button is pressed.
    // -----------------------------------------------------------------------------
    //
    void CSalvaLaCoppiaAppView:ialogDismissedL( TInt aButtonId )
    {
    // Check when pressing cancel button.
    if ( aButtonId == -1 )
    {
    delete iIdle;
    iIdle = NULL;
    }
    }
    My problem is that the two process (my activity too long and CAknProgressDialog), don't go togheter,but before one and when finish go second operation.
    What's problem?
    Thaks
    Silvia

  2. #2
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Malmö, Sweden
    Posts
    157

    Re: problema with CAknProgressDialog

    You should let the updateing of progressbar happen from your long running process...

    I see you have just copied the progress bar example more or less...

    For it to behave in any sane way, you need some kind of connection between progressbar updating and your long running process. (ofcourse)

    How are you running the long running process? another CIdle? if so, you could probably get it kindof working by setting them to the same priority.

    But much better to just update the progress note from your long running process.

  3. #3
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: problema with CAknProgressDialog

    Quote Originally Posted by olhed
    You should let the updateing of progressbar happen from your long running process...

    I see you have just copied the progress bar example more or less...

    For it to behave in any sane way, you need some kind of connection between progressbar updating and your long running process. (ofcourse)

    How are you running the long running process? another CIdle? if so, you could probably get it kindof working by setting them to the same priority.

    But much better to just update the progress note from your long running process.

    Hi,
    yes, my long process is in othe Idle.
    If I use same priority not work, when finish one process go other process
    How to update the progress note from my long running process?
    Best Regard
    Silvia

  4. #4
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Malmö, Sweden
    Posts
    157

    Re: problema with CAknProgressDialog

    Depends on your design..

    Maybe something like how you do it now from the unrelated CIdle?

    Try think about what a progressbar really is and how it works, and I think it will be obvious. (and no, its not by magic )

Similar Threads

  1. Sincronization problem - Problema de Sincronización
    By SerPan in forum Bluetooth Technology
    Replies: 0
    Last Post: 2006-11-24, 02:29
  2. Using CAknProgressDialog
    By urrg in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-12-29, 19:51
  3. How to use CAknProgressDialog in FEP application
    By sphinxgao in forum Symbian
    Replies: 0
    Last Post: 2003-10-31, 09:01
  4. CAknProgressDialog: how to compute aIncrement and aInterval values
    By zzeric in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-03-07, 14:58
  5. CAknProgressDialog question
    By epocware in forum Symbian User Interface
    Replies: 0
    Last Post: 2002-10-11, 07:47

Posting Permissions

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