Problems creating a CFbsBitmap object in a thread.

Login to reply to this topic.
Tue, 2005-08-02 14:49
Joined: 2004-10-01
Forum posts: 35
Hello All,
I am facing a problem in creating the CFbsBitmap in a thread. Below are the steps that i am doing.

1. There is Application UI thread (Say Hello World App's).
2. Creating a new thread in the UI thread.
3. In the new thread created, doing the following things.
           
               TSize Size(352,288);
     CFbsBitmap* Temp_Image=(CFbsBitmap*)new CFbsBitmap;   
    TInt Err = Temp_Image->Create(Size,EColor64K);
     if(Err != KErrNone)
   {
      RDebug::Printf("\nUnable to allocate mem for image--Error = %d", Err);
   }

This prints "Unable to allocate mem for image--Error = -34", which means (KErrCouldNotConnect ) unable to connect to the font and bitmap server.
I am not getting why it is returning like this.
Do i need to do something else before calling a Create() on CFbsBitmap object??

Please help

Thanks in Advance
Pinky

Tue, 2005-08-02 16:09
Joined: 2005-08-02
Forum posts: 6
Re: Problems creating a CFbsBitmap object in a thread.

Try calling:

Temp_Image -> Reset();

before calling Create()

Tue, 2005-08-02 19:41
Joined: 2005-08-01
Forum posts: 5
Re: Problems creating a CFbsBitmap object in a thread.
I do not remeber details, but I have uses
   RFbsSession fbsSession;
   if(bInThread)
      err = fbsSession.Connect();

for creating bitmaps in thread...
Wed, 2005-08-03 07:13
Joined: 2004-10-01
Forum posts: 35
Re: Problems creating a CFbsBitmap object in a thread.
Hi Ilye,
Thanks very much. RFbsSession worked for me. And i learned a new thing too Smiley

Thanks again
Pinky
Thu, 2005-08-04 12:29
Joined: 2005-07-28
Forum posts: 122
Re: Problems creating a CFbsBitmap object in a thread.
note: - the connect, and disconnect functions are static. No need for an instance.

RFbsSession::Connect();

// .. some work here

RFbsSession::Disconnect();
Fri, 2006-09-15 07:55
Joined: 2005-07-04
Forum posts: 59
Re: Problems creating a CFbsBitmap object in a thread.
Hi,

I tried using RFbsSession::Connect for creating a Bitmap in an EXE.
But the connect itself fails with -1.

I am trying it on emulator.
Can u pleasehelp me
  • Login to reply to this topic.