×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    WSERV 7 on loading a single bitmap .mbm file

    Hello,

    I added a START BITMAP directive in my .mmp file for a .mbm file with a single SOURCE .bmp file. This is meant to serve as an image that will be loaded and presented to the user, at the time of application start-up.
    In the code, I load the image to the CFbsBitmap object with the version of load, where in the last two arguments default to 0 and ETrue. In other words, I do not pass the aId argument, since there is only a single bitmap image.

    But I get a WSERV 7 panic when this line of code executes.

    Any idea what could be wrong?

    TIA
    Vin

  2. #2
    Super Contributor
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: WSERV 7 on loading a single bitmap .mbm file

    will you show that particular line of .mmp file , where you are define START BITMAP.
    Regards
    $-Nitesh-$

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: WSERV 7 on loading a single bitmap .mbm file

    _LIT(KMsgEditorMbm, "\\resource\\apps\\my.mbm");

    TFileName bitmapFile (KMsgEditorMbm);
    User::LeaveIfError (CompleteWithAppPath (bitmapFile));

    imyBitmap = new (ELeave) CFbsBitmap();
    User::LeaveIfError(imyBitmap->Load(bitmapFile, EMbmone));
    Now we can use the bitmap, could you check your path?

  4. #4
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: WSERV 7 on loading a single bitmap .mbm file

    Quote Originally Posted by Nitesh Bhardwaj View Post
    will you show that particular line of .mmp file , where you are define START BITMAP.
    Thanks. Here is the section:

    START BITMAP CardGameGUI.mbm
    TARGETPATH resource\apps
    SOURCEPATH ..\gfx
    HEADER
    SOURCE c16 BJ.bmp
    END


    VIN

  5. #5
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: WSERV 7 on loading a single bitmap .mbm file

    Quote Originally Posted by mahbub_s60 View Post
    _LIT(KMsgEditorMbm, "\\resource\\apps\\my.mbm");

    TFileName bitmapFile (KMsgEditorMbm);
    User::LeaveIfError (CompleteWithAppPath (bitmapFile));

    imyBitmap = new (ELeave) CFbsBitmap();
    User::LeaveIfError(imyBitmap->Load(bitmapFile, EMbmone));
    Now we can use the bitmap, could you check your path?
    Yes, I checked the path and it seems fine. It is set to "\\resource\\apps\\CardGameGUI.mbm".
    I had successfully loaded an image from the same path from another .mbm file for the project.
    VIN

  6. #6
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: WSERV 7 on loading a single bitmap .mbm file

    Quote Originally Posted by mahbub_s60 View Post
    _LIT(KMsgEditorMbm, "\\resource\\apps\\my.mbm");

    TFileName bitmapFile (KMsgEditorMbm);
    User::LeaveIfError (CompleteWithAppPath (bitmapFile));

    imyBitmap = new (ELeave) CFbsBitmap();
    User::LeaveIfError(imyBitmap->Load(bitmapFile, EMbmone));
    Now we can use the bitmap, could you check your path?
    I do not have the following lines in my code:
    TFileName bitmapFile (KMsgEditorMbm);
    User::LeaveIfError (CompleteWithAppPath (bitmapFile));
    But I guess that should not make a difference? Because I did not have these lines for the other .mbm file as well, and I was able to load the image, both on emulator as well as the device.

    Vin

  7. #7
    Super Contributor
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: WSERV 7 on loading a single bitmap .mbm file

    SOURCE c16 BJ.bmpEND[/B]
    are you sure, its 16 bit bitmap, try with C 24, instead of C 16.
    Regards
    $-Nitesh-$

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: WSERV 7 on loading a single bitmap .mbm file

    Looks all fine and now can you confirm imyBitmap (or similar variable is a member of the class)
    It may go out of scope

  9. #9
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: WSERV 7 on loading a single bitmap .mbm file

    Quote Originally Posted by Nitesh Bhardwaj View Post
    are you sure, its 16 bit bitmap, try with C 24, instead of C 16.
    I tried but get the same Panic. I wanted to share some info with the image.
    I had downloaded a . jpeg file from the web, saved it as 24 bit .bmp using Paint and then copied it to my project.
    thanks
    Vin

  10. #10
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: WSERV 7 on loading a single bitmap .mbm file

    Can you confirm as said in post #8?

  11. #11
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: WSERV 7 on loading a single bitmap .mbm file

    [QUOTE=mahbub_s60;785454]Can you confirm as said in post #8?[/QUOTE

    What I am doing is passing the CFbsBitmap* iBitmap member of the UI object, to a static method exposed by the View object. This static method NewL() is used by the UI object to construct the View object before drawing the image. The UI object allocates memory on the heap for the View object and stores the pointer returned by nee (ELeave) in a pointer member of type Container class.
    After doing so, it invokes the NewL() method using this pointer and passes the iBitmap member to be drawn on to the window.
    As far as I can see it, the iBitmap should be within scope.

  12. #12
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: WSERV 7 on loading a single bitmap .mbm file

    Sorry a minor correction. There is no separate allocation using new (ELeave). Rather NewL() itself allocates the memory.

  13. #13
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: WSERV 7 on loading a single bitmap .mbm file

    I just tried a User::LeaveIfError() at the place of loading the .mbm file. And it fails at that point.
    I checked the path and it looks fine to me.
    Not sure what could be causing this issue...still debugging

    Vin

  14. #14
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: WSERV 7 on loading a single bitmap .mbm file

    -If the path is correct n ow you check the bitmap mask if it is correct?
    -Also you can try to find the leave code coming from Load(..)

  15. #15
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: WSERV 7 on loading a single bitmap .mbm file

    Quote Originally Posted by mahbub_s60 View Post
    -If the path is correct n ow you check the bitmap mask if it is correct?
    -Also you can try to find the leave code coming from Load(..)
    I am not sure how to find the leave code?
    Please help.

Similar Threads

  1. WSERV 7 while loading a bitmap on device
    By pooja_1650 in forum Symbian
    Replies: 2
    Last Post: 2009-12-09, 05:27
  2. Creating MBM using bitmap file
    By enable.skill in forum Symbian
    Replies: 5
    Last Post: 2009-02-10, 09:22
  3. How to create mbm file from 24 bit bitmap file??
    By pankaj gupta55 in forum Symbian
    Replies: 2
    Last Post: 2008-08-19, 12:07
  4. how can i add one bitmap to mbm file?
    By k.sandeep in forum Symbian
    Replies: 1
    Last Post: 2006-03-20, 07:06
  5. WSERV 10 Panic with bitmap loading
    By fullscale in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-10-24, 08:01

Posting Permissions

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