Windows Media Format SDK banner art
PreviousNext

IWMHeaderInfo::SetAttribute

The SetAttribute method sets a descriptive attribute that is stored in the header section of the Windows Media file.

Syntax

HRESULT SetAttribute(
  WORD  wStreamNum,
  LPCWSTR  pszName,
  WMT_ATTR_DATATYPE  Type,
  const BYTE*  pValue,
  WORD  cbLength
);

Parameters

  wStreamNum

[in]  Word containing the stream number.

  pszName

[in]  Pointer to a NULL-terminated string containing the name.

  Type

[in]  One member of the WMT_ATTR_DATATYPE enumeration type.

  pValue

[in]  Pointer to a byte array.

  cbLength

[in]  Size of pValue, in bytes.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Meaning
E_INVALIDARG One or more of the parameters are NULL.
NS_E_INVALID_STATE The writer is not in a configurable state, or no profile has been set.
E_UNEXPECTED The method failed for an unspecified reason.

Remarks

This SDK does not support attributes with stream numbers.  So the stream number should always be set to zero, indicating that the attribute applies to the entire current file.

The writer supports this method only before the BeginWriting method has been called.  The reader does not support this method.

See Also

PreviousNext


© 1999 Microsoft Corporation. All rights reserved.