Share via


IItem::Edit

4/8/2010

The Edit method opens the PIM item for editing in it's Edit tab.

Syntax

HRESULT Edit(
  HWND hwndParent
);

Parameters

  • hwndParent
    [in] Handle to the parent window.

Return Value

This method returns the standard values, , , , and, as well as the following:

  • S_OK
    The method completed successfully.
  • E_INVALIDARG
    The hwndParent parameter was invalid.
  • E_OUTOFMEMORY
    Not enough memory to complete the operation.
  • E_ACCESSDENIED
    Insufficient permissions. Access denied.
  • E_UNEXPECTED
    Unexpected error.
  • E_FAIL
    The method failed.
  • E_NOTIMPL
    The method was called on an item of type OlAppointmentItem on Windows Mobile Standard.
  • S_FALSE
    The user clicked Cancel to discard the changes.

Remarks

You can call IItem::Edit on unsaved as well as saved PIM items.

IItem::Edit is not supported for Appointment items on Windows Mobile Standard.

Code Example

The following code example demonstrates how to use Edit.

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 EditExample(IItem *pItem)
{
    HRESULT hr   = E_FAIL;
    HWND    hWnd = NULL;
    // You should set the hWnd to the window you want the summary card to be parented to.
    // If hWnd = NULL, then it uses the hwnd passed into IPOutlookApp::Logon.
    // The edit card that is displayed depends upon the item type.
    hr = pItem->Edit(hWnd);
    // This statement is reached when the edit card is dismissed.
    return hr;
}

Requirements

Header pimstore.h
Library Pimstore.lib
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

See Also

Reference

IItem
OlItemType

Other Resources