Follow these procedures for adding and deleting records from the Contacts 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
}
'