本文整理汇总了C++中LPMESSAGE::SetProps方法的典型用法代码示例。如果您正苦于以下问题:C++ LPMESSAGE::SetProps方法的具体用法?C++ LPMESSAGE::SetProps怎么用?C++ LPMESSAGE::SetProps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPMESSAGE
的用法示例。
在下文中一共展示了LPMESSAGE::SetProps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddReportTag
HRESULT AddReportTag(LPMESSAGE lpMessage)
{
if (!lpMessage) return MAPI_E_INVALID_PARAMETER;
HRESULT hRes = S_OK;
ULONG cValues = 0;
LPSPropValue lpPropArray = NULL;
SizedSPropTagArray(2, sptaProps) = { 2, { PR_PARENT_ENTRYID, PR_SEARCH_KEY } };
hRes = lpMessage->GetProps((LPSPropTagArray)&sptaProps, 0, &cValues, &lpPropArray);
if (SUCCEEDED(hRes))
{
SPropValue sProp = { 0 };
sProp.ulPropTag = PR_REPORT_TAG;
hRes = BuildReportTag(NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
(lpPropArray[0].ulPropTag == PR_PARENT_ENTRYID) ? lpPropArray[0].Value.bin.cb : 0,
(lpPropArray[0].ulPropTag == PR_PARENT_ENTRYID) ? lpPropArray[0].Value.bin.lpb : 0,
(lpPropArray[1].ulPropTag == PR_SEARCH_KEY) ? lpPropArray[1].Value.bin.cb : 0,
(lpPropArray[1].ulPropTag == PR_SEARCH_KEY) ? lpPropArray[1].Value.bin.lpb : 0,
"",
&sProp.Value.bin.cb,
&sProp.Value.bin.lpb);
if (SUCCEEDED(hRes) && sProp.Value.bin.cb && sProp.Value.bin.lpb)
{
hRes = lpMessage->SetProps(1, &sProp, NULL);
}
delete[] sProp.Value.bin.lpb;
}
return hRes;
}
示例2: SetPropsA
HRESULT SetPropsA(
LPMESSAGE lpMessage,
LPSTR szSubject, // PR_SUBJECT_W, PR_CONVERSATION_TOPIC
LPSTR szBody, // PR_BODY_W
LPSTR szRecipientName, // Recipient table
BOOL bHighImportance, // PR_IMPORTANCE
BOOL bReadReceipt, // PR_READ_RECEIPT_REQUESTED
BOOL bSubmit,
BOOL bDeleteAfterSubmit,
ULONG msgSaveFlag,
LPMAPISESSION lpMAPISession = NULL) {
SPropValue spvProps[NUM_PROPS] = { 0 };
spvProps[p_PR_MESSAGE_CLASS_W].ulPropTag = PR_MESSAGE_CLASS_A;
spvProps[p_PR_ICON_INDEX].ulPropTag = PR_ICON_INDEX;
spvProps[p_PR_SUBJECT_W].ulPropTag = PR_SUBJECT_A;
spvProps[p_PR_CONVERSATION_TOPIC_W].ulPropTag = PR_CONVERSATION_TOPIC_A;
spvProps[p_PR_BODY_W].ulPropTag = PR_BODY_A;
spvProps[p_PR_IMPORTANCE].ulPropTag = PR_IMPORTANCE;
spvProps[p_PR_READ_RECEIPT_REQUESTED].ulPropTag = PR_READ_RECEIPT_REQUESTED;
spvProps[p_PR_MESSAGE_FLAGS].ulPropTag = PR_MESSAGE_FLAGS;
spvProps[p_PR_MSG_EDITOR_FORMAT].ulPropTag = PR_MSG_EDITOR_FORMAT;
spvProps[p_PR_MESSAGE_LOCALE_ID].ulPropTag = PR_MESSAGE_LOCALE_ID;
spvProps[p_PR_INETMAIL_OVERRIDE_FORMAT].ulPropTag = PR_INETMAIL_OVERRIDE_FORMAT;
spvProps[p_PR_DELETE_AFTER_SUBMIT].ulPropTag = PR_DELETE_AFTER_SUBMIT;
spvProps[p_PR_INTERNET_CPID].ulPropTag = PR_INTERNET_CPID;
spvProps[p_PR_CONVERSATION_INDEX].ulPropTag = PR_CONVERSATION_INDEX;
spvProps[p_PR_MESSAGE_CLASS_W].Value.lpszA = "IPM.Note";
spvProps[p_PR_ICON_INDEX].Value.l = 0x103; // Unsent Mail
spvProps[p_PR_SUBJECT_W].Value.lpszA = szSubject;
spvProps[p_PR_CONVERSATION_TOPIC_W].Value.lpszA = szSubject;
spvProps[p_PR_BODY_W].Value.lpszA = szBody;
spvProps[p_PR_IMPORTANCE].Value.l = bHighImportance ? IMPORTANCE_HIGH : IMPORTANCE_NORMAL;
spvProps[p_PR_READ_RECEIPT_REQUESTED].Value.b = bReadReceipt ? true : false;
spvProps[p_PR_MESSAGE_FLAGS].Value.l = MSGFLAG_UNSENT;
spvProps[p_PR_MSG_EDITOR_FORMAT].Value.l = EDITOR_FORMAT_PLAINTEXT;
spvProps[p_PR_MESSAGE_LOCALE_ID].Value.l = 2052;//1033; // (en-us)
spvProps[p_PR_INETMAIL_OVERRIDE_FORMAT].Value.l = NULL; // Mail system chooses default encoding scheme
spvProps[p_PR_DELETE_AFTER_SUBMIT].Value.b = bDeleteAfterSubmit ? true : false;
spvProps[p_PR_INTERNET_CPID].Value.l = CONVERT_CODE_PAGE;// cpidASCII;
HRESULT hRes = BuildConversationIndex(
&spvProps[p_PR_CONVERSATION_INDEX].Value.bin.cb,
&spvProps[p_PR_CONVERSATION_INDEX].Value.bin.lpb);
if (SUCCEEDED(hRes))
{
hRes = lpMessage->SetProps(NUM_PROPS, spvProps, NULL);
if (SUCCEEDED(hRes))
{
if (lpMAPISession)
hRes = AddRecipientA(lpMAPISession,
lpMessage,
MAPI_TO,
szRecipientName);
else
hRes = AddRecipientA(lpMessage,
MAPI_TO,
szRecipientName);
if (SUCCEEDED(hRes))
{
if (bReadReceipt)
{
hRes = AddReportTag(lpMessage);
}
if (SUCCEEDED(hRes))
{
hRes = lpMessage->SaveChanges(msgSaveFlag);
if (SUCCEEDED(hRes) && bSubmit)
{
hRes = lpMessage->SubmitMessage(NULL);
}
}
}
}
}
if (spvProps[p_PR_CONVERSATION_INDEX].Value.bin.lpb)
delete[] spvProps[p_PR_CONVERSATION_INDEX].Value.bin.lpb;
return hRes;
}