IPOlRecipient::Resolve
The Resolve method matches first and last names of a recipient against the people in the Contacts database on the Windows Mobile-based device. It looks both for complete and for partial matches. After obtaining a match it sets the Name and Address properties for the recipient.
Syntax
HRESULT Resolve(
VARIANT BOOL fDisplayUI,
VARIANT BOOL * pfResolved
);
Parameters
- fDisplayUI
[in] If TRUE, Resolve displays a dialog box listing all matching e-mail. The user can then select the address for the Contact's Address property. The parent handle for this dialog box is the window handle provided in IPOutlookApp::Logon. If FALSE, Resolve does not resolve the address when there is more than one match and the pfResolved parameter returns FALSE. - pfResolved
[out] TRUE if the name resolves properly; FALSE if it does not.
Return Values
On Smartphone, this method returns E_NOTIMPL.
On Pocket PC, this method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:
- S_OK
The method completed successfully.
Remarks
To get a reference to IPOlRecipient, first get a reference to an IRecipient object and then call IUnknown::QueryInterface. If QueryInterface fails, the object does not support the interface, so you cannot call Resolve. Checking for this is useful if you want to write code that runs on Windows CE 2.0 in addition to Windows CE 3.0 — only Windows CE 3.0 and later support the IPOlRecipient interface.
If more than one Contact item matches the recipient, then the Contact Chooser appears, prompting the user to select the correct Contact item.
Code Example
The following code example shows how to resolve a recipient.
Note To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.
void ResolveName(IRecipients * pRecipientList)
{
IRecipient * pRecip;
IPOlRecipient * pRecip2;
BSTR pwsz;
pRecipientList->Add(TEXT("Tom"), &pRecip);
// Call QueryInterface to get the new interface on the same recipient.
pRecip->QueryInterface(IID_IPOlRecipient, (LPVOID*)&pRecip2);
// Resolve the name.
pRecip2->Resolve();
// You can examine the Address with either pRecip
// or pRecip2--they both point to the same object.
pRecip->get_Address(&pwsz);
// or...
pRecip2->get_Address(&pwsz);
SysFreeString(pwsz);
// Release both objects.
pRecip2->Release();
pRecip->Release();
}
Requirements
Pocket PC: Pocket PC 2000 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later
Header: pimstore.h
Library: pimstore.lib
See Also
How to: Create a Meeting Request | IPOlRecipient | IRecipient | IRecipients | Pocket Outlook Object Model API Interfaces
Send Feedback on this topic to the authors