Ejemplo n.º 1
0
// Categories are stored under the multi-value named property CATEGORIES_PROPERTY
String MAPIContact::GetCategories() {
	String strCategories;
#ifdef _WIN32_WCE
	return GetPropertyString(OUTLOOK_CATEGORIES, strCategories);
#else
	LPSPropValue pProp;
	if(GetNamedProperty(CATEGORIES_PROPERTY, pProp)) {
		strCategories = "";

		ULONG i;
		String strCategory;
		for(i = 0; i < pProp->Value.MVi.cValues; i++) {
			strCategory = MAPIEx::GetValidMVString(*pProp, i);
			if(strCategory.GetLength()) {
				if(strCategories.GetLength()) 
					strCategories += ';';
				strCategories += strCategory;
			}
		}
		MAPIFreeBuffer(pProp);
		return strCategories;
	}
	return String();
#endif
}
BOOL CExMapiNamedProperty::GetNamedProperty(LPCTSTR szFieldName,CString& strField)
{
	LPSPropValue pProp;
	if(GetNamedProperty(szFieldName,pProp)) {
		strField=CExMapi::GetValidString(*pProp);
		MAPIFreeBuffer(pProp);
		return TRUE;
	}
	return FALSE;
}