×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    4

    how is it possible to wait the end of a asynchron process?

    Hello,
    I try to wait the end of the CImageEncoder conversion saving a bitmap. I want load it just after in order to verify if it well saved.
    I wrote on my class:

    TBool CCImageProcessor::Save(CFbsBitmap & aBitmap/*, RFs *aFs */)
    {
    TInt index = 0;
    do
    {
    iNewFileName.Copy( iImagePath->Des() );
    iNewFileName.Append( KImageFileNamePicture );

    TBuf<K2FileNameIndexMaxLength> num;
    num.Num( index );
    iNewFileName.Append( num );
    iNewFileName.Append(KbmpFileExtension);


    iNewFileName.Append( K2pngFileExtension );
    if ( !BaflUtils::FileExists( iEikEnv->FsSession(), iNewFileName ) )//verify if the name without the extension is allready used
    break;
    index ++;
    } while ( 1 );

    RFs* aFs =&(iEikEnv->FsSession());
    const TFileName *aNewFilePathAndName = &iNewFileName;
    if ( !iEncoder )
    iEncoder = CImageEncoder::FileNewL(*aFs, *aNewFilePathAndName, KbmpMimeType, CImageEncoder::EOptionAlwaysThread);

    // If it is not busy, start to do the conversion.
    if ( !IsActive() )
    {
    iStatus=KRequestPending;
    iEncoder->Convert( &iStatus, aBitmap );
    SetActive();
    iState=EConvertingImage;
    return ETrue;
    }
    return EFalse;

    }

    And I test :
    CCImageProcessor *imagep;
    CFbsBitmap * offScreenBitmap;
    CFbsBitmap * iLoadedBitmap;

    I initialized each bitmap, created imagep object and i do :

    imagep->Save(*offScreenBitmap);
    User::WaitForRequest(imagep->iStatus);
    imagep->LoadBitmap(iLoadedBitmap,0);
    User::WaitForRequest(imagep->iStatus);


    It can not Load the bitmap but I put a WaitForRequest...
    Need help

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

    Re: how is it possible to wait the end of a asynchron process?

    Can you try out with real active objects and see whether there are any error's reported in any stages, as well as if the RunL gets called with errors or not.

Similar Threads

  1. Replies: 2
    Last Post: 2009-05-01, 14:44
  2. Series 60 SDK Appwizard on windows xp
    By moonjoor in forum Symbian Tools & SDKs
    Replies: 15
    Last Post: 2003-12-24, 10:22
  3. D211 sending picture SMSs
    By Patru in forum General Messaging
    Replies: 1
    Last Post: 2003-03-27, 13:59
  4. SMS Msg using VB Application
    By gurup83 in forum General Messaging
    Replies: 2
    Last Post: 2002-07-11, 04:48
  5. Replies: 0
    Last Post: 2002-05-30, 06:53

Posting Permissions

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