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

Adding contact problem.

0 replies · 3,697 views · Started 24 February 2007

Hi everyone,

I try to write a small application to add a contact to the phone book. But it keep giving me the error (System Error(-23)). Here is my code.

CPbkContactEngine* pbkContactEng = CPbkContactEngine::NewL(NULL);
CleanupStack::PushL( pbkContactEng );

CPbkContactItem* aContactItem = pbkContactEng->CreateEmptyContactL();
CleanupStack::PushL( aContactItem );

_LIT(aValue,"name"😉;
TBufC<10> aBuf(aValue);
TPbkContactItemField* fieldFirstName = aContactItem->FindField(EPbkFieldIdFirstName);
fieldFirstName->TextStorage()->SetTextL(aBuf);

pbkContactEng->AddNewContactL(*aContactItem, EFalse);

CleanupStack::PopAndDestroy(2);

I am new to Symbian Programming so I would be very very appreciate if anyone would help me on this problem.

Thank you very much and looking forward for your help.