I though it was about time I got back to starting to write in symbian again 😊 after about 5 months of doing other coding, any how as I said in the title I'm goind theough the example in
Carbide_vs_Getting_Started_Guide_version_2_0.pdf
It's in the nokia directory, but I'm having hassle on on running the Program after and on Page 22 its when I add teh Bitmap
I've done this:
MySampleContainer.h / MySampleContainer2.h
private: //data
CEikLabel* iLabel; // example label
CEikLabel* iToDoLabel; // example label
CFbsBitmap* iBitmap; // I've ADDDED this.
MySampleContainer.cpp / MySampleContainer2.cpp
#include "MySample.mbg" // I've ADDDED this.
#include "AknUtils.h" // I've ADDDED this.
void CMySampleContainer::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\n here"😉 );
SetRect(aRect);
ActivateL();
_LIT(KBackgroundBitmap, "MySample.mbm"😉; // I've ADDDED this.
TFileName fname(KBackgroundBitmap); // I've ADDDED this.
CompleteWithAppPath(fname); // from AknUtils // I've ADDDED this.
iBitmap = new (ELeave) CFbsBitmap(); // I've ADDDED this.
}
// Destructor
CMySampleContainer::~CMySampleContainer()
{
delete iLabel;
delete iToDoLabel;
delete iBitmap; // I've ADDDED this.
}
void CMySampleContainer:😃raw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
// TODO: Add your drawing code here
// example code...
gc.SetPenStyle( CGraphicsContext::ENullPen );
gc.SetBrushColor( KRgbGray );
gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
gc.DrawRect( aRect );
gc.DrawBitmap(aRect, iBitmap); // I've ADDDED this.
}
I've Added the Fbscli.lib to the Linker in the properites page.
I think it might be the PKG file I'm doing something wrong here????
My MySample.pkg is this:
;
; Installation file for MySample application
;
;Languages
&EN
;
; UID is the app's UID
;
#{"MySample"},(0x02b471c3),1,0,0
;
;Supports Series 60 v 2.0
;This line indicates that this installation is for the Series 60 platform v2.0
;This line must appear _exactly_ as shown below in the sis file
;If this line is missing or incorrect, the sis file will not be able
;to be installed on Series 60 v2.0 platforms
(0x101F7960), 0, 0, 0, {"Series60ProductID"}
;
; Four files to install
;
"..\..\..\\Epoc32\release\thumb\urel\MySample.app" -"!:\system\apps\MySample\MySample.app"
"..\..\..\\Epoc32\data\z\system\apps\MySample\MySample.rsc" -"!:\system\apps\MySample\MySample.rsc"
"..\..\..\\Epoc32\data\z\system\apps\MySample\MySample_caption.rsc" -"!:\system\apps\MySample\MySample_caption.rsc"
"..\..\..\\Epoc32\data\z\system\apps\MySample\MySample.aif" -"!:\system\apps\MySample\MySample.aif"
"..\..\..\\Epoc32\data\z\system\apps\MySample\MySample.mbm" -"!:\system\apps\MySample\MySample.mbm" // I've ADDDED this.
It compiles ok but gives an exception error, but when I comment out:
gc.DrawBitmap(aRect, iBitmap); it works ok. so I'm assuning that the variable iBitmap is null??
Please can anybody help
the pig..
P.s I've attached a zip file with the source code in it