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


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

本文整理汇总了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;
}
开发者ID:haiyangIt,项目名称:Haiyang,代码行数:36,代码来源:Store.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::SetProps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。