IContactProperties::GetBinary method (icontact.h)

Retrieves the binary data of a property using an IStream interface [Structured Storage].

Syntax

HRESULT GetBinary(
  [in]      LPCWSTR pszPropertyName,
  [in]      DWORD   dwFlags,
  [in, out] LPWSTR  pszContentType,
  [in]      DWORD   cchContentType,
  [in, out] DWORD   *pdwcchContentTypeRequired,
  [out]     IStream **ppStream
);

Parameters

[in] pszPropertyName

Type: LPCWSTR

Specifies the property to retrieve.

[in] dwFlags

Type: DWORD

Must be CGD_DEFAULT.

[in, out] pszContentType

Type: LPWSTR

Specifies user-allocated buffer to store the MIME content type.

[in] cchContentType

Type: DWORD

Specifies the allocated buffer size in characters.

[in, out] pdwcchContentTypeRequired

Type: DWORD*

On failure, contains the required size for pszContentType.

[out] ppStream

Type: IStream**

On success, contains a new IStream interface [Structured Storage]. Use this to retrieve the binary data.

Return value

Type: HRESULT

Returns one of the following values:

Return code Description
S_OK
ppStream contains an IStream interface [Structured Storage]. Caller must release the reference.
S_FALSE
No data for this value. Either the property has been present in the past but its value has been removed or the property is a container of other properties (toplevel/secondlevel[3]). The buffer at pszContentType has been zeroed.
ERROR_PATH_NOT_FOUND
No data found for this property name.
ERROR_INVALID_DATATYPE
Unable to get value for this property due to schema.
ERROR_INSUFFICIENT_BUFFER
pszContentType was not large enough to store the value. The required buffer size is stored in pdwcchContentTypeRequired.

Remarks

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

To retrieve a value from a multi-value (hierarchical) property, include the desired index as part of pszPropertyName using the form: toplevel/secondlevel[1]/thirdlevel. NOTE: the first element of a set is index 1, so index [0] is invalid.

For deleted properties, this method returns S_OK and an IStream interface [Structured Storage] of zero length. NOTE: For properties not of binary type, this method may return incorrect data in the IStream.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header icontact.h (include Contact.h)
DLL Wab32.dll (Version 6.0 or later)