Windows Media Format SDK banner art
PreviousNext

IWMHeaderInfo::GetAttributeByIndex

The GetAttributeByIndex method returns a descriptive attribute that is stored in the header section of the Windows Media file, if the attribute index is specified.

Syntax

HRESULT GetAttributeByIndex(
  WORD  wIndex,
  WORD*  pwStreamNum,
  WCHAR*  pwszName,
  WORD*  pcchNameLen,
  WMT_ATTR_DATATYPE*  pType,
  BYTE*  pValue,
  WORD*  pcbLength
);

Parameters

  wIndex

[in]  Word containing the index.

  pwStreamNum

[in] Pointer to a word containing the stream number.

  pwszName

[out]  Pointer to a wide-character NULL-terminated string containing the name.

  pcchNameLen

[in, out]  On input, specifies a pointer to a variable containing the length of the pwszName array in wide characters (two bytes). On output, and if the method succeeds, the variable contains the actual length of the name.

  pType

[out]  Pointer to a variable containing one member of the WMT_ATTR_DATATYPE enumeration type.

  pValue

[out]  Pointer to a byte array containing the value.

  pcbLength

[in, out]  On input, specifies a pointer to a variable containing the length of the pValue array in bytes. On output, and if the method succeeds, the variable contains the actual number of bytes written to pValue by the method.

Return Values

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

Return code Meaning
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.
ASF_E_BUFFERTOOSMALL The pValue array is too small to contain the attribute value.

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.

Calling the Wmaplay sample for content with banner images would cause the ASF_E_BUFFERTOOSMALL error, since the buffer size allocated in this sample is 512 bytes, which is not enough to contain a banner image.

See Also

PreviousNext


© 1999 Microsoft Corporation. All rights reserved.