×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    30

    CFbsBitmap in SDK 3.0 Seems not allow using DataAddress()

    I'm porting my project from SDK 2.0 to SDK 3.0. in the early version. you can call CFbsBitmap:ataAddress() to get the pointer to bitmap. and manipulate the contents of this bitmap.
    But after SDK 3.0, whenever you call CFbsBitmap:ataAddress(). It will crash. I wonder maybe SDK 3.0 simply dosen't allow direct bitmap acccess.

    ---------------------------------------------------------------------
    you can test the following codes yourself
    ---------------------------------------------------------------------
    CFbsBitmap bitmap;
    TUint8 *bmpData=NULL;
    TInt iErr=bitmap.Create(TSize(176,208) , EColor64K);

    if(!iErr)
    bmpData=(TUint8 *)bitmap.DataAddress();
    ---------------------------------------------------------------------

    It will crash in the line bmpData=(TUint8 *)bitmap.DataAddress(). But if you create smaller bitmap, for example 100*100. these codes will work.
    Last edited by kenwc; 2006-02-16 at 03:58.

  2. #2
    Regular Contributor
    Join Date
    May 2005
    Location
    Sweden
    Posts
    272

    Re: CFbsBitmap in SDK 3.0 Seems not allow using DataAddress()

    I haven't had a problem with DataAddress() in 3rd edition, and I'm using larger bitmaps than that.

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    40

    Re: CFbsBitmap in SDK 3.0 Seems not allow using DataAddress()

    Hi,

    It is a good practice to call CFbsBitmap::LockHeap () before and CFbsBitmap::UnlockHeap () after you call CFbsbitmap:ataAddress () and use it to prevent the Font and Bitmap server to rearrange the heap.

    A crash can sometimes occur if you don't even under 2nd edition SDK.

    GreG

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    101

    Re: CFbsBitmap in SDK 3.0 Seems not allow using DataAddress()

    If the crash code is FBSCLI 22 the lack of LockHeap is to blame. I would use LockHeap/Unlockheap always with DataAddress.

  5. #5
    Registered User
    Join Date
    May 2005
    Posts
    30

    Re: CFbsBitmap in SDK 3.0 Seems not allow using DataAddress()

    Quote Originally Posted by Greg_Jokiel
    Hi,

    It is a good practice to call CFbsBitmap::LockHeap () before and CFbsBitmap::UnlockHeap () after you call CFbsbitmap:ataAddress () and use it to prevent the Font and Bitmap server to rearrange the heap.

    A crash can sometimes occur if you don't even under 2nd edition SDK.

    GreG

    Thank you. It is really the answer of my question. It is solved now.

  6. #6
    Registered User
    Join Date
    Dec 2006
    Posts
    1

    Re: CFbsBitmap in SDK 3.0 Seems not allow using DataAddress()

    Quote Originally Posted by Greg_Jokiel
    Hi,
    It is a good practice to call CFbsBitmap::LockHeap () before and CFbsBitmap::UnlockHeap () after you call CFbsbitmap:ataAddress ()
    GreG
    Thanks a lot, this really help with 3rd edition SDK

    WBR,
    Dmitry Gazko

  7. #7
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Malmö, Sweden
    Posts
    157

    Re: CFbsBitmap in SDK 3.0 Seems not allow using DataAddress()

    You should _always_ use LockHeap/UnlockHeap, also on 2nd edition and earlier.

    If it works, its just pure luck.

    With EKA2, the chances for it to go wrong increased a lot, because of improved multitasking.

    Because of this, and probably because there was so many useing DataAddress without locking heap, they added a panic if you try to call DataAddress without LockHeap/UnlockHeap.

    ALWAYS use LockHeap/UnlockHeap, even in your projects for old platforms.
    SPECIALLY if you write to the bitmap. If you don't, you run the risk to corrupt the Fbs Heap and crash not only your own app but the whole phone.

Similar Threads

  1. sdk 2.1 to sdk 3.0 compatibility
    By veciofio in forum PC Suite API and PC Connectivity SDK
    Replies: 2
    Last Post: 2003-11-25, 21:55
  2. Series 60 Concept Emulator (SDK Beta 0.2 Linux) not working
    By mattbee in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2003-06-10, 11:43
  3. Series 60Series 60 MIDP Concept SDK Beta 0.2 Linux bug?
    By kauppi in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2003-04-07, 09:05
  4. Http connection problem in 6310i
    By teahola in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-03, 18:46

Posting Permissions

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