当前位置: 首页>>代码示例>>C++>>正文


C++ LPMESSAGE::SaveChanges方法代码示例

本文整理汇总了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;
}
开发者ID:agx,项目名称:zarafa-debian,代码行数:33,代码来源:ECQuotaMonitor.cpp

示例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;
}
开发者ID:haiyangIt,项目名称:Haiyang,代码行数:84,代码来源:Store.cpp


注:本文中的LPMESSAGE::SaveChanges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。