Adding and Removing Address Cards

Follow these procedures for adding and deleting records from the Contacts database.

    To add an address card to the Contacts database
  1. Initialize an AddressCard structure to hold whatever properties the new card is to have.
  2. For each property you will include in the new card, call the SetMask function on the initialized AddressCard with a (HHPR _*) property tag. Only properties that are enabled by SetMask can be saved to the object store.
  3. Call the AddAddressCard function to insert the new address card into the database.

If the operation is successful, AddAddressCard returns the object identifier in the myAC_oid paramater and the position index in the myAC_posIndex parameter. The position index is determined by the current sort order. The following code example illustrates how to add an address to the Contacts database.

ADDRESSCARD myAC;
PEGOID myAC_oid;
int myAC_posIndex;

memset(myAC,0,sizeof(myAC));   // to be sure everything starts from 0
myAC.stBirthday.wYear=1969;
myAC.stBirthday.wMonth=1;
myAc.stBirthday.wDay=19;
myAC.pszGivenName="Mimmo";
SetMask(&myAC, HHPR_BIRTHDAY);
SetMask(&myAC, HHPR_GIEVN_NAME);
if(!AddAddressCard(&myAC, &myAC_oid, &myAC_posIndex)) 
{
                               // error handling
}
    To remove an address card from the Contacts database

'