I am trying to retrieve number of contacts available in contacts database of Nokia Communicator using Series 40 SDK. I can see only 2 contacts on the communicator phonebook but when i tried to find it in my program its showing more.

My Code:

CContactDatabase* iContact=CContactDatabase::OpenL();
CContactArray* contacts=iContact->StoredItemsL();
TInt count=contacts->Count();

Here my count is returning more number of contacts than existing. and when i tried to delete one of the contact its giving 'contact not found' error.

I feel When we delete a contact on the device it is setting a delete flag to true rather than deleting the contact permanently. Is it correct? If so how do i find the status of a the contact and actual contacts count?

Please let me know.