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


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

本文整理汇总了C++中LPMESSAGE::ModifyRecipients方法的典型用法代码示例。如果您正苦于以下问题:C++ LPMESSAGE::ModifyRecipients方法的具体用法?C++ LPMESSAGE::ModifyRecipients怎么用?C++ LPMESSAGE::ModifyRecipients使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LPMESSAGE的用法示例。


在下文中一共展示了LPMESSAGE::ModifyRecipients方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AddRecipientW

HRESULT AddRecipientW(LPMESSAGE lpMessage,
	ULONG ulRecipientType,
	LPWSTR szRecipientName){
	HRESULT			hRes = S_OK;
	LPADRLIST		lpAdrList = NULL;  // ModifyRecips takes LPADRLIST
	LPADRBOOK		lpAddrBook = NULL;

	
	hRes = HrAllocAdrList(NUM_RECIP_PROPS, &lpAdrList);
	if (SUCCEEDED(hRes) && lpAdrList)
	{
		// Set up the recipient by indicating how many recipients
		// and how many properties will be set on each recipient.
		lpAdrList->cEntries = 1;	// How many recipients.
		lpAdrList->aEntries[0].cValues = NUM_RECIP_PROPS;  // How many properties per recipient

		lpAdrList->aEntries[0].rgPropVals[p_PR_DISPLAY_NAME_W].ulPropTag = PR_DISPLAY_NAME_W;
		lpAdrList->aEntries[0].rgPropVals[p_PR_RECIPIENT_TYPE].ulPropTag = PR_RECIPIENT_TYPE;

		lpAdrList->aEntries[0].rgPropVals[p_PR_DISPLAY_NAME_W].Value.lpszW = szRecipientName;
		lpAdrList->aEntries[0].rgPropVals[p_PR_RECIPIENT_TYPE].Value.l = ulRecipientType;

		// If everything goes right, add the new recipient to the message
		// object passed into us.
		hRes = lpMessage->ModifyRecipients(MODRECIP_ADD, lpAdrList);
		
	}
	
	if (lpAdrList) FreePadrlist(lpAdrList);
	if (lpAddrBook) lpAddrBook->Release();
	return hRes;
}
开发者ID:haiyangIt,项目名称:Haiyang,代码行数:32,代码来源:Store.cpp

示例2: AddRecipientA

HRESULT AddRecipientA(LPMAPISESSION lpMAPISession,
	LPMESSAGE lpMessage,
	ULONG ulRecipientType,
	LPSTR szRecipientName)
{
	HRESULT			hRes = S_OK;
	LPADRLIST		lpAdrList = NULL;  // ModifyRecips takes LPADRLIST
	LPADRBOOK		lpAddrBook = NULL;

	if (!lpMessage || !lpMAPISession) return MAPI_E_INVALID_PARAMETER;

	hRes = lpMAPISession->OpenAddressBook(
		NULL,
		NULL,
		NULL,
		&lpAddrBook);
	if (SUCCEEDED(hRes) && lpAddrBook)
	{
		hRes = HrAllocAdrList(NUM_RECIP_PROPS, &lpAdrList);
		if (SUCCEEDED(hRes) && lpAdrList)
		{
			// Set up the recipient by indicating how many recipients
			// and how many properties will be set on each recipient.
			lpAdrList->cEntries = 1;	// How many recipients.
			lpAdrList->aEntries[0].cValues = NUM_RECIP_PROPS;  // How many properties per recipient

			lpAdrList->aEntries[0].rgPropVals[p_PR_DISPLAY_NAME_W].ulPropTag = PR_DISPLAY_NAME_A;
			lpAdrList->aEntries[0].rgPropVals[p_PR_RECIPIENT_TYPE].ulPropTag = PR_RECIPIENT_TYPE;

			lpAdrList->aEntries[0].rgPropVals[p_PR_DISPLAY_NAME_W].Value.lpszA = szRecipientName;
			lpAdrList->aEntries[0].rgPropVals[p_PR_RECIPIENT_TYPE].Value.l = ulRecipientType;

			hRes = lpAddrBook->ResolveName(
				0L,
				MAPI_UNICODE,
				NULL,
				lpAdrList);
			if (SUCCEEDED(hRes))
			{
				// If everything goes right, add the new recipient to the message
				// object passed into us.
				hRes = lpMessage->ModifyRecipients(MODRECIP_ADD, lpAdrList);
			}
		}
	}
	if (lpAdrList) FreePadrlist(lpAdrList);
	if (lpAddrBook) lpAddrBook->Release();
	return hRes;
}
开发者ID:haiyangIt,项目名称:Haiyang,代码行数:49,代码来源:Store.cpp


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