×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    8

    KERN-EXEC 3 while using bitmap and AknIconUtils

    Hi all,
    I'm facing problems using bitmaps. I created 5 image controls in my GUI without specifying "Image" property, and then in my code I tried to set the same bitmap for all 5 objects, but unfortunately I get a KERN-EXEC 3 panic code.

    Reading some threads I probably found the reason of this, but I didn't find the solution. This is my code, actually used by the Container::ConstructL function but it could be called in different functions during the execution:

    Code:
    	CFbsBitmap *bitmap, *mask;
    
    //	Load BMP, no mask required
    	AknIconUtils::CreateIconL( bitmap, mask, wMBM2Path, EMbmTexasholdemteacher2Dr, -1 );
    
    //	Set the same BMP on various image controls
    	iImgFlop1->SetBitmap(bitmap);
    	iImgFlop2->SetBitmap(bitmap);
    	iImgFlop3->SetBitmap(bitmap);
    	iImgTurn->SetBitmap(bitmap);
    	iImgRiver->SetBitmap(bitmap);
    Maybe I'm wrong but I read that doing this, at the end of the program it tries to destroy the same bitmap 5 times, because every SetBitmap() links the bitmap to more than one object. I read something about a SwapBitmap function instead of SetBitmap, but I cannot find it. I also tried SetPicture but the result is the same. Also I tried "bitmap->Load()" instead of AknIconUtils but the panic error remained.

    Please can anybody help me? I would also understand the difference between "SetBitmap() / SetPicture()" and "bitmap->Load() / AknIconUtils" because reading the documentation I still am in trouble deciding which one I have to use.

    Thank you!

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,570

    Re: KERN-EXEC 3 while using bitmap and AknIconUtils

    CFbsBitmap::Load can deal with .mbm files only. AknIconUtils is able to load icons from .mbm-s and .mif-s too.
    I am not sure about what you exactly expect from passing -1 as mask id - CreateIconL has variants expecting a single identifier (and simply returning a single CFbsBitmap).
    Are iImgXy-s constructed properly? If not, calling any method on them certainly causes KERN-EXEC 3.
    SetBitmap and SetPicture are methods of totally different classes - that may considered as a difference.

  3. #3
    Super Contributor
    Join Date
    Jun 2004
    Location
    SymbianLand
    Posts
    763

    Re: KERN-EXEC 3 while using bitmap and AknIconUtils

    Things to check:
    1. Check if the bitmap object is valid.
    2. Probably SetBitmap takes ownership of the bitmap and hence after being deleted once, the code crashes with a KE3.
    3. One of the options is to create 5 instances of the bitmap and pass it to each control separately. Not a good one but will work for sure.
    4. Also what class type is this iImgFlop1?

Similar Threads

  1. AknIconUtils SetSize issue
    By Shilpa13 in forum Symbian User Interface
    Replies: 6
    Last Post: 2008-01-24, 11:31
  2. AknIconUtils is caching the image
    By Tatanka.nbr1 in forum Symbian
    Replies: 12
    Last Post: 2007-01-05, 19:08

Posting Permissions

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