Partager via


IWMPMedia3::getAttributeCountByType method

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The getAttributeCountByType method returns the number of attributes associated with the specified attribute type.

Syntax

public System.Int32 getAttributeCountByType(
  System.String bstrType,
  System.String bstrLanguage
);

Public Function getAttributeCountByType( _
  ByVal bstrType As System.String, _
  ByVal bstrLanguage As System.String _
) As System.Int32
Implements IWMPMedia3.getAttributeCountByType

Parameters

bstrType [in]

A System.String that is the attribute type.

bstrLanguage [in]

A System.String that is the language. If the value is set to null or a zero-length string (""), the current locale string is used. Otherwise, the value must be a valid RFC 1766 language string such as "en-us".

Return value

A System.Int32 that is the count of attributes that are associated with the type.

Remarks

This method is used to discover the number of attributes corresponding to a particular attribute name for a given media item. Index numbers can then be passed to the getItemInfoByType method. This is useful, for example, when a media item has been categorized under multiple genres.

Before calling this method, you must have read access to the library. For more information, see Library Access.

Requirements

Requirement Value
Version
Windows Media Player 9 Series or later
Namespace
WMPLib
Assembly
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

See also

IWMPMedia3 Interface (VB and C#)

IWMPMedia3.getItemInfoByType (VB and C#)