×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Oct 2004
    Location
    India
    Posts
    138

    CContactItem fails to read fields of a contact

    Hi,
    my task is to read all the contacts in a contact db and find out if they have thumbnails or not.
    It is being done like this.

    ///////////////////////////////////////////////////////////////////
    CContactDatabase* contactDB = CContactDatabase::OpenL();
    CleanupStack::PushL(contactDB);

    CContactItem* contactItem = contactDB->ReadContactLC(id);
    CContactItemFieldSet& ref = contactItem->CardFields();

    picIndex = contactItem->CardFields().Find(KUidContactFieldPicture);
    ///////////////////////////////////////////////////////////////////

    The above code, works fine as long as the contact has thumbnail,
    When the code encounters the contact with out thumbnail for the first time,
    the picIndex value is -1 and all subsequent contacts (even if they have thumbnail)
    are shown as not having thumbnail and picIndex value is -1.

    I tried to search the forum, but of no use.
    Is this a known issue??
    please help.

    Note: deleting and opening contact database for every new request does not help.

  2. #2
    Super Contributor
    Join Date
    Jul 2004
    Location
    Romania
    Posts
    560

    Re: CContactItem fails to read fields of a contact

    How do you get the id used in contactDB->ReadContactLC(id)?

    L

  3. #3
    Regular Contributor
    Join Date
    Oct 2004
    Location
    India
    Posts
    138

    Re: CContactItem fails to read fields of a contact

    that was trivial, i get it from sortbytypel or sorteditemsl.

    is this the root cause, because the same contact id works fine, if the first contact that encountered has thumbnail.

    br,
    - kc

  4. #4
    Super Contributor
    Join Date
    Jul 2004
    Location
    Romania
    Posts
    560

    Re: CContactItem fails to read fields of a contact

    Quote Originally Posted by ruchaitu View Post
    that was trivial, i get it from sortbytypel or sorteditemsl.

    is this the root cause, because the same contact id works fine, if the first contact that encountered has thumbnail.

    br,
    - kc
    Yep...I think the problem is with contact ids

  5. #5
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: CContactItem fails to read fields of a contact

    Have you confirmed id is actually different each time you call ReadContactLC() ?

  6. #6
    Regular Contributor
    Join Date
    Oct 2004
    Location
    India
    Posts
    138

    Re: CContactItem fails to read fields of a contact

    sorry for the late update.
    the id was actually a reference to integer.
    what i did was, i assigned it to a new local integer varable and passed to it seperately and things started working fine.
    thanks for the hint.

    br,
    - kc

Similar Threads

  1. Adding contact fails
    By Emil_Gunnarsson in forum Mobile Java General
    Replies: 7
    Last Post: 2010-06-07, 11:19
  2. can't read contact
    By ningdai in forum Symbian
    Replies: 1
    Last Post: 2004-09-21, 10:10
  3. Contact Read Error from 6600
    By Maverick_SA in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2004-03-24, 05:37
  4. read contact data on windows
    By madgeek in forum Symbian
    Replies: 0
    Last Post: 2004-01-21, 11:33
  5. Replies: 1
    Last Post: 2002-12-02, 12:15

Posting Permissions

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