×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jun 2003
    Posts
    318

    Problem displaying background image

    Hi dudes

    I just created a barebones app using App Wizard, with view architecture support. I wrote some code to display a background image in teh container but the application crashes when i load it. No compilation errors. My container is derived from CCoeControl and MCoeControlObserver.

    void CTestContainer::ConstructL(const TRect& aRect)
    {
    CreateWindowL();

    iLabel = new (ELeave) CEikLabel;
    iLabel->SetContainerWindowL( *this );
    iLabel->SetTextL( _L("Example View") );

    iToDoLabel = new (ELeave) CEikLabel;
    iToDoLabel->SetContainerWindowL( *this );
    iToDoLabel->SetTextL( _L("Add Your controls here") );


    _LIT(KF2FMbmFileName, "\\system\\apps\\test\\test.mbm");
    //iBackgroundImage = NBitmapMethods::CreateBitmapL(KF2FMbmFileName,EMbmTestBackground);

    if (iBackgroundImage->Load(KF2FMbmFileName, EMbmTestBackground, EFalse) != KErrNone)
    User::InfoPrint(_L("Load success"));


    SetRect(aRect);
    ActivateL();
    }


    void CTestContainer::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();


    gc.DrawBitmap(aRect, iBackgroundImage);


    // TODO: Add your drawing code here
    // example code...
    //gc.SetPenStyle(CGraphicsContext::ENullPen);
    //gc.SetBrushColor(KRgbGray);
    //gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    //gc.DrawRect(aRect);
    }


    Can someone see what my problem here is? No compilation errors. Program crashes upon loading. Not even the image shows up.

    - aDvo -

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    Were you able to track it down where exactly it crashes? Using debugger...

    Does it crash on emulator or on a real device?

    Do you have your file placed in the right directory? On emulator it should be in "\Symbian\6.1\Series60\Epoc32\Wins\c\system\Apps\YourApp". On a real device you should be aware of different "disks" where your app can be installed.

  3. #3
    Regular Contributor
    Join Date
    Jun 2003
    Posts
    318

    Sopta = genius

    Thanks for replying sopta.

    It crashes on the emulator.
    sopta you are a genius.. It works! thanks!

    However i do have a question...

    What is the difference between having the mbm file in

    C:\Symbian\6.1\Series60\Epoc32\Wins\c\system\Apps\TEST

    and

    C:\Symbian\6.1\Series60\Epoc32\Release\wins\udeb\z\system\apps\F2F

    My program called F2F gets its icons for its listbox from the 'z' drive, and it works fine. The only F2F.mbm file is in the 'z' directory above. I didn't have to move the mbm file to \Wins\c\system\Apps\F2F ( there is no such directory in the first place).

    Why is it for the TEST application i had to move it to 'c'?

    btw, the mbm file paths in the F2F application and TEST application are as follows:

    _LIT(KF2FMbmFileName, "\\system\\apps\\F2F\\F2F.mbm");

    _LIT(KF2FMbmFileName, "\\system\\apps\\test\\test.mbm");

    They are the same aren't they? (except for the app name).

    Is is becoz TEST is using the bitmap for background image and F2F for listbox ? =P.. cant be right.

    Confused..

    Thanks again

  4. #4
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    50
    Hi Sopta

    For me its working on the emulator but not on the phone.

    I did
    bldmake bldfiles
    abld build wins udeb
    abld build armi urel
    Edited the F2F.Pkg to include the mbm file::

    "\Symbian\6.1\Series60\Epoc32\release\armi\urel\F2F.app" -"!:\system\apps\F2F\F2F.app"
    "\Symbian\6.1\Series60\Epoc32\release\armi\urel\F2F.rsc" -"!:\system\apps\F2F\F2F.rsc"
    "\Symbian\6.1\Series60\Epoc32\release\armi\urel\F2F_caption.rsc" -"!:\system\apps\F2F\F2F_caption.rsc"
    "\Symbian\6.1\Series60\Epoc32\release\armi\urel\F2F.aif" -"!:\system\apps\F2F\F2F.aif"
    "\Symbian\6.1\Series60\Epoc32\release\armi\urel\F2F.mbm" -"!:\system\apps\F2F\F2F.mbm"


    I install and run the application on the phone.

    They give me error
    App Closed: F2F WSERV 7
    argh..

    Edit::::::::::::::::

    Problem solved.. if interested see:
    http://discussion.forum.nokia.com/fo...threadid=31117
    Last edited by ThreeSixFiveOh; 2003-11-18 at 17:05.

Posting Permissions

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