IItem::Copy

Send Feedback

The Copy method creates a copy of a PIM item.

Syntax

HRESULT Copy(
  IItem ** ppolCopy
);

Parameters

  • ppolCopy
    [out] Reference to the copied PIM item object.

Return Values

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.

Code Example

The following code example demonstrates how to use Copy.

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.

HRESULT CopyExample(IItem *pItem)
{

    HRESULT hr       = E_FAIL;
    IItem *pItemCopy = NULL;
    hr               = pItem->Copy(&pItemCopy);

    // pItemCopy contains a copy of the pItem object.
    // All properties, including named properties, are copied.
    // Named properties created with the PIM_DONTREPLICATE set are not copies.

    if(NULL != pItemCopy)
    {
        pItemCopy->Release();
    }

    return hr;

}

Requirements

Pocket PC: Windows Mobile Version 5.0 and later
Smartphone: Windows Mobile Version 5.0 and later
OS Versions: Windows CE 5.01 and later
Header: pimstore.h
Library: pimstore.lib

See Also

IItem | Pocket Outlook Object Model API Interfaces | Pocket Outlook Object Model API Enumerations

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.