I'm trying to get the timestamp of item fields of a contact item (which could be different from the timestamp of the contact item itself). However, I'm unable to access the DateTimeStorage() function of CContactItemField class.
My code is:
// Open the contact, pushing it onto the cleanup stack.
CContactItem *contact = cdb->OpenContactLX(aEvent.iContactId);
// Modification time of Contact Item
TTime ctime = contact->LastModified();
CContactItemFieldSet& fieldSet = contact->CardFields();
CContactDateField *modifDate = fieldSet.DateTimeStorage(); /* --- CRASH HERE --- */
// Modification time of Item Field
TTime ftime = modifDate->Time();
My code crashes on the line indicated above. Could you please tell me where I'm going wrong.