IMAPIProp::SetProps

4/8/2010

The SetProps method updates one or more properties.

Syntax

HRESULT SetProps (
  ULONG cValues,
  LPSPropValue lpPropArray,
  LPSPropProblemArray FAR * lppProblems
);

Parameters

  • cValues
    [in] Count of property values pointed to by lpPropArray; cannot be zero.
  • lpPropArray
    [in] Reference to an array of SPropValue structures holding property values to be updated; cannot be NULL.
  • lppProblems
    [in] Ignored.

Return Value

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

  • S_OK
    Indicates success.
  • MAPI_E_COMPUTED
    The property cannot be updated because it is read-only, computed by the service provider responsible for the object.
  • MAPI_E_INVALID_TYPE
    The property type is invalid.
  • MAPI_E_NO_ACCESS
    An attempt was made to modify a read-only object or to access an object for which the user has insufficient permissions.
  • MAPI_E_NOT_ENOUGH_MEMORY
    The property cannot be updated because it is larger than the RPC buffer size.
  • MAPI_E_UNEXPECTED_TYPE
    The property type is not the type expected by the calling implementation.

Remarks

If you include a property tag for a property that is unsupported by the object and the implementation of SetProps allows the creation of new properties, the property is added to the object. Any previous value stored with the property identifier used for the new property is discarded.

The S_OK return value does not guarantee that all of the properties were successfully updated. Some providers cache SetProps calls until they receive a call that requires provider intervention, such as IMAPIProp::GetProps. Therefore, it is possible to receive error values relating to the SetProps call with the later calls.

When updating large properties, SetProps can fail and return MAPI_E_NOT_ENOUGH_MEMORY. There is no maximum size for properties, and different objects can have different limits. If you deal with potentially large properties, call OpenProperty instead of SetProps when SetProps returns this error value.

Requirements

Header mapidefs.h
Library cemapi.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2002 and later, Smartphone 2002 and later

See Also

Reference

IMAPIProp
IMAPIProp::GetProps
MAPIFreeBuffer
SPropProblemArray
SPropValue

Other Resources

Messaging