Discussion Board
error creating graphic context: error C2065:'SystemGc' : undeclared identifier
2003-11-17, 13:38
#1
Regular Contributor
My line of code:
CWindowGc& gc = SystemGc();
Error:
error C2065: 'SystemGc' : undeclared identifier
what header file/ library am i missing??
Thanks
Regular Contributor
If you are inside CCoeControl class methods, like Draw() you can use CCoeControl's SystemGc() method. Otherwise please use iCoeEnv->SystemGc().
Best Regards,
(V) - Forum Nokia
Regular Contributor
Denever
Thanks..
I was trying to do it within my View's (CAknView) ConstructL method.
Anyway, I'm now trying to place a background image in my Container (CCoeControl).
When my program runs the 2nd line of code the program crashes.
_LIT(KF2FMbmFileName2, "\\system\\apps\\F2F\\F2F.mbm");
iBackgroundImage = NBitmapMethods::CreateBitmapL(KF2FMbmFileName2, EMbmF2fBackground);
I've already included the namespace file bitmapmethods.h and bitmapmethods.cpp.
The mbm and mbg files are created. This is from my mbg file
enum TMbmF2f
{
EMbmF2fBackground,
EMbmF2fCheck_yes,
EMbmF2fCheck_yes_mask,
EMbmF2fCheck_no,
EMbmF2fCheck_no_mask
};
I don't know why even the 2nd line of code can fail. Any ideas Denever?
Regular Contributor
I decided to try it displaying the background image using the View(CAknView) again instead of the Container.
I now have this in the ConstructL() method of the View
void CF2FMainView::ConstructL()
{
BaseConstructL( R_F2F_MAIN_VIEW );
_LIT(KF2FMbmFileName, "\\system\\apps\\F2F\\F2F.mbm");
iBackgroundImage = NBitmapMethods::CreateBitmapL(KF2FMbmFileName,EMbmF2fBackground);
//CWindowGc& gc = SystemGc();
CWindowGc& gc = iCoeEnv->SystemGc();
gc.BitBlt(Rect().iTl,iBackgroundImage);
But the compiler has a problem with Rect():
'Rect' : undeclared identifier
So i change it to this, since ClientRect() is from CAknView:
gc.BitBlt(ClientRect().iTl,iBackgroundImage);
It compiles fine, but when i run the application it crashes, telling me "System Error!!!"
pls help me denever!
Solved..
2003-11-18, 12:38
#5
Regular Contributor
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules