IWMDMMetaData::AddItem method (mswmdm.h)

The AddItem method adds a metadata property to the interface.

Syntax

HRESULT AddItem(
  [in] WMDM_TAG_DATATYPE Type,
  [in] LPCWSTR           pwszTagName,
  [in] BYTE              *pValue,
  [in] UINT              iLength
);

Parameters

[in] Type

An WMDM_TAG_DATATYPE enumerated value specifying the type of metadata being saved.

[in] pwszTagName

Pointer to a wide-character, null-terminated string specifying the name of the property to set. A list of standard property name constants is given in Metadata Constants.

[in] pValue

Pointer to a byte array specifying the value to assign to the property. The submitted value is copied, so the memory can be freed after calling AddItem.

[in] iLength

Integer specifying the size of pValue, in bytes.

Return value

The method returns an HRESULT. All the interface methods in Windows Media Device Manager can return any of the following classes of error codes:

  • Standard COM error codes
  • Windows error codes converted to HRESULT values
  • Windows Media Device Manager error codes
For an extensive list of possible error codes, see Error Codes.

Requirements

Requirement Value
Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

IWMDMMetaData Interface

Metadata Constants

Setting Metadata on a File