src/native/addrbook/msoutlook/MsOutlookUtils.cxx
/**
 * Get one property for a given contact.
 *
 * @param mapiProp A pointer to the contact.
 * @param propTag The tag of the property to get.
 * @param prop The memory location to store the property value.
 *
 * @return S_OK if everything work fine. Any other value is a failure.
 */
Get one property for a given contact.
@param mapiProp A pointer to the contact.
@param propTag The tag of the property to get.
@param prop The memory location to store the property value.

@return S_OK if everything work fine. Any other value is a failure.
Get one property for a given contact . @param mapiProp A pointer to the contact . @param propTag The tag of the property to get . @param prop The memory location to store the property value . @return S_OK if everything work fine . Any other value is a failure .
HRESULT
MsOutlookUtils_HrGetOneProp(
        LPMAPIPROP mapiProp,
        ULONG propTag,
        LPSPropValue *prop)
{
    SPropTagArray propTagArray;
    HRESULT hResult;
    ULONG valueCount;
    LPSPropValue values;
    propTagArray.cValues = 1;
    propTagArray.aulPropTag[0] = propTag;
    hResult = mapiProp->GetProps(&propTagArray, 0, &valueCount, &values);
    if (HR_SUCCEEDED(hResult))
    {
        ULONG i;
        jboolean propHasBeenAssignedTo = JNI_FALSE;
        for (i = 0; i < valueCount; i++)
        {
            LPSPropValue value = values;
            values++;
            if (value->ulPropTag == propTag)
            {
                *prop = value;
                propHasBeenAssignedTo = JNI_TRUE;
            }
            else
                MAPIFreeBuffer(value);
        }
        if (!propHasBeenAssignedTo)
        {
        	MsOutlookUtils_log("MsOutlookUtils_HrGetOneProp: Property not found.");
            hResult = MAPI_E_NOT_FOUND;
        }
        MAPIFreeBuffer(values);
    }
    else
    {
    	MsOutlookUtils_log("MsOutlookUtils_HrGetOneProp: MAPI getProps error.");
    }
    return hResult;
}
HRESULT MsOutlookUtils_HrGetOneProp ( LPMAPIPROP mapiProp , ULONG propTag , LPSPropValue * prop ) { SPropTagArray propTagArray ; HRESULT hResult ; ULONG valueCount ; LPSPropValue values ; propTagArray . cValues = 1 ; propTagArray . aulPropTag [ 0 ] = propTag ; hResult = mapiProp -> GetProps ( & propTagArray , 0 , & valueCount , & values ) ; if ( HR_SUCCEEDED ( hResult ) ) { ULONG i ; jboolean propHasBeenAssignedTo = JNI_FALSE ; for ( i = 0 ; i < valueCount ; i ++ ) { LPSPropValue value = values ; values ++ ; if ( value -> ulPropTag == propTag ) { * prop = value ; propHasBeenAssignedTo = JNI_TRUE ; } else MAPIFreeBuffer ( value ) ; } if ( ! propHasBeenAssignedTo ) { MsOutlookUtils_log ( " " ) ; hResult = MAPI_E_NOT_FOUND ; } MAPIFreeBuffer ( values ) ; } else { MsOutlookUtils_log ( " " ) ; } return hResult ; }
Get one property for a given contact.
Get one property for a given contact .