Hello,
I'm using the following code to access PIM:
The problem is that with this code, if the number is not stored on the phone then I would have to create a new contact using the phone's own PIM so that I would have it with my code. I'm guessing the problem is with CPbkMultipleEntryFetchDlg which only lists phone numbers. Is there anything else that I can use which would provide me with the ability to enter a number direct along with listing the stored ones?Code:void CPbAppUi::GetNumberFromPhonebook(TDes& aPhoneNumber) { RPbkViewResourceFile phonebookResource(*(CEikonEnv::Static())); if (!phonebookResource.IsOpen()) phonebookResource.OpenL(); CPbkContactEngine* iPbkContactEngine = CPbkContactEngine::NewL(); // Add searching array to parameters CContactDatabase::TContactViewFilter filter(CContactDatabase::ESmsable); CPbkMultipleEntryFetchDlg::TParams params; params.iContactView = &iPbkContactEngine->FilteredContactsViewL(filter); // Launch fetching dialog CPbkMultipleEntryFetchDlg* fetchDlg = CPbkMultipleEntryFetchDlg::NewL(params, *iPbkContactEngine); fetchDlg->SetMopParent(this); TInt okPressed = fetchDlg->ExecuteLD(); if (okPressed) { TBuf<30> phoneNumber; TInt paramCount = params.iMarkedEntries->Count(); // Get the selected contacts id array for (TInt i=0; i<paramCount; ++i) { const TContactItemId cid = (*params.iMarkedEntries)[i]; // Open the selected contact using Phonebook engine, choose correct number (launch list query if needed) CPbkContactItem* pbkItem = iPbkContactEngine->ReadContactLC(cid); TPbkContactItemField* tmp; tmp = pbkItem->FindField(EPbkFieldIdPhoneNumberMobile); if ((tmp = pbkItem->FindField(EPbkFieldIdPhoneNumberMobile)) != NULL) { phoneNumber = tmp->Text(); } else if ((tmp = pbkItem->FindField(EPbkFieldIdPhoneNumberGeneral)) != NULL) { phoneNumber = tmp->Text(); } } aPhoneNumber = phoneNumber; } }



