本文整理汇总了C++中LPMESSAGE::SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C++ LPMESSAGE::SaveChanges方法的具体用法?C++ LPMESSAGE::SaveChanges怎么用?C++ LPMESSAGE::SaveChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPMESSAGE
的用法示例。
在下文中一共展示了LPMESSAGE::SaveChanges方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateQuotaTimestamp
/**
* Writes the new timestamp in the store to now() when the last quota
* mail was send to this store. The store must have been opened as
* SYSTEM user, which can always write, eventhough the store is over
* quota.
*
* @param[in] lpMDB Store to update the last quota send timestamp in
* @return MAPI error code
*/
HRESULT ECQuotaMonitor::UpdateQuotaTimestamp(LPMESSAGE lpMessage)
{
HRESULT hr = hrSuccess;
SPropValue sPropTime;
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
sPropTime.ulPropTag = PR_EC_QUOTA_MAIL_TIME;
sPropTime.Value.ft = ft;
hr = HrSetOneProp(lpMessage, &sPropTime);
if (hr != hrSuccess)
goto exit;
hr = lpMessage->SaveChanges(KEEP_OPEN_READWRITE);
if (hr != hrSuccess) {
m_lpThreadMonitor->lpLogger->Log(EC_LOGLEVEL_FATAL, "Unable to save config message, error code: 0x%08X", hr);
goto exit;
}
exit:
return hr;
}
示例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;
}