Compartir a través de


IPOlRecipient::Resolve (Windows CE 5.0)

Send Feedback

This method matches first and last names of a recipient against the people in the Contacts database on the Windows CE-based device. It looks for both complete and partial matches. After obtaining a match it sets the Name and Address properties for the recipient.

HRESULT Resolve(VARIANT_BOOLfDisplayUI,VARIANT_BOOL* pfResolved);

Parameters

  • fDisplayUI
    [in] If TRUE, Resolve displays a dialog box listing all matching e-mail addresses if there is more than one matching address. 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 the Login call. If FALSE, Resolve does not resolve the address when there is more than one match and the pfResolved parameter returns FALSE. This parameter is optional for Visual BASIC, with a default value of FALSE.
  • pfResolved
    [out] Set to TRUE if the name resolves properly or FALSE if it does not.

Return Values

S_OK indicates there were no errors whether or not the name resolved properly. If an error occurs, the appropriate HRESULT is returned.

Remarks

To get a pointer to IPOlRecipient, first get a pointer to an IRecipient interface and then call the IUnknown method 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 supports the IPOlRecipient interface.

Example

The following code example shows how to resolve a recipient.

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

OS Versions: Windows CE 2.0 and later.
Header: Pimstore.h.
Link Library: Pimstore.lib.

See Also

IRecipient

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.