×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    CImageDecoder::FileNewL => code 10

    Hi Folks,
    ICL doesn't like me too much - the latest is an error 10 which occurs at this line:
    Code:
      	   myDecoder = CImageDecoder::FileNewL(CCoeEnv::Static()->FsSession(),completePath);
    The completePath variable has been checked with the emulator an appears sensible, yet an error 10 occurs.

    NewLC says that this is an underflow error...but what does this mean? The png/jpg file was created with ICL just minutes before.

    Finally, here is the complete code:
    Code:
    void CLocaNotePaint::ConstructL (const TRect& /*aRect*/)
        {
        // Create a window for this application view
           CreateWindowL ( );
    
           EnableDragEvents();
    
           // This class rotates backbuffer (=picture on screen) when terminal
           // oreintation changes
           iBackBufferRotator = CBitmapRotatorAO::NewL(this);
    
           iAppUi = (static_cast<CLocaNoteAppUi*>(iEikonEnv->AppUi()));
           iAknToolbar = iAppUi->CurrentPopupToolbar();
    
           // Use whole screen _ WE DIE HERE
           SetExtentToWholeScreen();
           
           // Initialize component array
           InitComponentArrayL();
           
           // Custom CToolbarControl toolbar control
           iCustomToolbarControl = CToolbarControl::NewL(this,Rect(),iMotherView);
           iCustomToolbarControl->SetLeft();
           Components().AppendLC(iCustomToolbarControl);
           CleanupStack::Pop(); // iCustomToolbarControl
    
           // Create drawing engine
           iDrawingEngine = CDrawingEngine::NewL(Window(),SystemGc(),iBackBufferContext,iCustomToolbarControl);
           if(iFileName.Length()<3)
        	   {   
               iDrawingEngine->SetUseBgc(ETrue); // Draws default to back buffer
        	   }
           else
        	   { 
        	   CImageDecoder* myDecoder;
        	   TFileName filename;
        	   filename.Copy(iFileName);
        	   filename.TrimLeft();
        	   
        	    TFileName completePath;
        	    RFs &fs=CCoeEnv::Static()->FsSession();
        	    fs.PrivatePath(completePath);
        	    completePath.Append(filename);
        	    #ifndef __WINS__
        	    CompleteWithAppPath(completePath);
        	    #endif
        	   
        	   myDecoder = CImageDecoder::FileNewL(CCoeEnv::Static()->FsSession(),completePath);
        	   
        	   TRequestStatus xy;
        	   
        	   myDecoder->Convert(&xy, *(this->iBackBuffer));
        	   
        	   while(xy.Int()!=KErrNone);
        	   }
           iDrawingEngine->SetColor(KRgbRed); // Use read color as default
           iDrawingEngine->SetPenSize(TSize(KMINPenSize,KMINPenSize)); // Default pen size
           
           // Activate the window, which makes it ready to be drawn
           ActivateL ( );
        }
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

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

    Re: CImageDecoder::FileNewL => code 10

    it might work better if you would use it as a member variable, as well as you should really use it with real active object.

  3. #3
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: CImageDecoder::FileNewL => code 10

    Hi,
    thank you so much for your reply!

    Use what as member variable / active object?

    All the best
    Tam Hanna
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  4. #4
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: CImageDecoder::FileNewL => code 10

    Hi,
    I have now moved myDecoder and xy to member variables, but still get the same error...

    All the best
    Tam
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  5. #5
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: CImageDecoder::FileNewL => code 10

    If you haven't used the ICL before it might be better to start from a working piece of example code and modify it to suit your needs.

    This code:
    Code:
     TRequestStatus xy;
        	   
     myDecoder->Convert(&xy, *(this->iBackBuffer));
        	   
     while(xy.Int()!=KErrNone);
    strongly suggests that you don't understand how to use active objects to wrap an asynchronos service provider. There are examples showing how to use the CImageDecoder in the Wiki, perhaps you could start with one of those?

    Sorcery

  6. #6
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: CImageDecoder::FileNewL => code 10

    Quote Originally Posted by Sorcery-ltd View Post
    If you haven't used the ICL before it might be better to start from a working piece of example code and modify it to suit your needs.

    This code:
    Code:
     TRequestStatus xy;
        	   
     myDecoder->Convert(&xy, *(this->iBackBuffer));
        	   
     while(xy.Int()!=KErrNone);
    strongly suggests that you don't understand how to use active objects to wrap an asynchronos service provider. There are examples showing how to use the CImageDecoder in the Wiki, perhaps you could start with one of those?

    Sorcery
    Hi,
    I have googled the Wiki before using the Forum Nokia Search, but found nothing.

    I would be thankful for a link!

    All the best
    Tam Hanna
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  7. #7
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: CImageDecoder::FileNewL => code 10

    Hi,
    already found sth - it is here:
    http://wiki.forum.nokia.com/index.ph..._image_to_JPEG

    Getting to work now!

    All the best
    Tam
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  8. #8
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: CImageDecoder::FileNewL => code 10

    Hi,

    I agree completely that the search is pathetic.

    The article you've found appears to be for CImageEncoder, it also uses the camera which may complicate things unecessarily.

    This might be better:
    http://wiki.forum.nokia.com/index.php/How_to_read_images_to_Symbian_bitmap


    Hope that helps,
    Mark

  9. #9
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: CImageDecoder::FileNewL => code 10

    Hi,
    I have now redone it to use active objects, but still get the same dreaded Error 10 message!

    All the best
    Tam Hanna
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  10. #10
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: CImageDecoder::FileNewL => code 10

    Hi,
    ohshit!

    I just detected that the pngs which my program creates are invalid for some reason.

    Uh-oh!

    So it looks like all of this is superfluous...

    All the best
    Tam
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  11. #11
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: CImageDecoder::FileNewL => code 10

    Yes, invalid files format will create that error. However, this wasn't a waste of time because you've already fixed the next error you would have faced - that the convert stage didn't actually happen because you were waiting in a while loop in the same thread that was supposed to be doing the decode!

    Sorcery

  12. #12
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: CImageDecoder::FileNewL => code 10

    Quote Originally Posted by Sorcery-ltd View Post
    Yes, invalid files format will create that error. However, this wasn't a waste of time because you've already fixed the next error you would have faced - that the convert stage didn't actually happen because you were waiting in a while loop in the same thread that was supposed to be doing the decode!

    Sorcery
    Thank you so much!

    Symbian can be a b*tch
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

Similar Threads

  1. Tell me, which is the better code option?
    By raj8nokiaforum in forum Symbian
    Replies: 3
    Last Post: 2008-10-21, 22:36
  2. Replies: 2
    Last Post: 2007-10-05, 20:40
  3. Link errors when trying to Display bitmap
    By Bkc82 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2006-01-16, 22:46
  4. Replies: 0
    Last Post: 2003-09-26, 15:07

Posting Permissions

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