Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User kenwc's Avatar
    Join Date
    May 2005
    Posts
    30
    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 ptrmn's Avatar
    Join Date
    May 2005
    Location
    Sweden
    Posts
    272
    I haven't had a problem with DataAddress() in 3rd edition, and I'm using larger bitmaps than that.

  3. #3
    Registered User Greg_Jokiel's Avatar
    Join Date
    Oct 2005
    Posts
    40
    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 bitnir's Avatar
    Join Date
    Mar 2003
    Posts
    101
    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 kenwc's Avatar
    Join Date
    May 2005
    Posts
    30
    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 khumen's Avatar
    Join Date
    Dec 2006
    Posts
    1
    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 olhed's Avatar
    Join Date
    Jan 2005
    Location
    Malmö, Sweden
    Posts
    157
    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. Nokia PC Connectivity能否链接到cdma手机上发送短信和其他操作?
    By bborn in forum Web Technologies and Multimedia Content- Web 技术和多媒体内容
    Replies: 2
    Last Post: 2004-05-04, 11:06
  2. 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
  3. 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
  4. 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
  5. 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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved