Share via


IContactProperties::SetBinary Method

Sets the binary data at a specified property to the contents of a specified IStream interface [Structured Storage], which contains a null-terminated string (as MIME type) data.

Syntax

HRESULT SetBinary(      
    LPCWSTR pszPropertyName,
    DWORD dwFlags,
    LPWSTR pszContentType,
    IStream *pStream
);

Parameters

  • pszPropertyName
    [in] Specifies the property to set.
  • dwFlags
    [in] CGD_DEFAULT can be used to create or overwrite the value at pszPropertyName.
  • pszContentType
    [in] Specifies null-terminated string representing MIME type to store when CGD_DEFAULT.
  • pStream
    [in] Pointer to IStream interface [Structured Storage] object containing data to place at this node. NOTE: IStream::Read is called for the data until it succeeds with a zero-length read. Any other return value results in a failure and no change.

Return Value

Returns one of the following values:

S_OK Value is set successfully.
ERROR_PATH_NOT_FOUND Property name is invalid for set, or property name doesn't exist for delete.
ERROR_INVALID_DATATYPE Unable to set the value for this property due to schema.

Remarks

To set a single-level property, set pszPropertyName to the property name.

To set a property from a multi-value property, set pszPropertyName to the form: toplevel/secondlevel[4]/thirdlevel.