Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Getting phone no from the contact database

0 replies · 1,706 views · Started 14 June 2006

hello everyone,

when i receive message in my application what i get is the name instead of the number, if the contact is stored in the contact database.

i get this name in TBufC<15> itext(entry.iDetails);
now i have tried like this but it gives me error e32user cbase 21.

what i want is little help from you people, i have been using symbian sdk 7.0for development.
here is my code: please correct me where i am wrong

CPbkContactEngine* CE = CPbkContactEngine::NewL();
CContactIdArray* contactidarray = CContactIdArray::NewL();

const TDesC aText(_L("vasant"😉); // contact to be found

// i have contact of this name so for checking i took vasant//

const CPbkFieldIdArray* aFieldTypes = NULL;

contactidarray = CE->FindLC ( aText ,aFieldTypes );
CPbkContactItem* contactItem = CE->ReadContactL ( contactitemid[0]);
TPbkContactItemField* contactItemField = NULL;
contactItemField = contactItem->FindField(EPbkFieldIdPhoneNumberMobile);
const TPtrC16 ptr = contactItemField->Text();

thanks and waiting ...........