IMFAttributes::GetItemByIndex method (mfobjects.h)
Retrieves an attribute at the specified index.
Syntax
HRESULT GetItemByIndex(
[in] UINT32 unIndex,
[out] GUID *pguidKey,
[in, out] PROPVARIANT *pValue
);
Parameters
[in] unIndex
Index of the attribute to retrieve. To get the number of attributes, call IMFAttributes::GetCount.
[out] pguidKey
Receives the GUID that identifies this attribute.
[in, out] pValue
Pointer to a PROPVARIANT that receives the value. This parameter can be NULL. If it is not NULL, the method fills the PROPVARIANT with a copy of the attribute value. Call PropVariantClear to free the memory allocated by this method.
Return value
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code | Description |
---|---|
|
The method succeeded. |
|
Invalid index. |
Remarks
To enumerate all of an object's attributes in a thread-safe way, do the following:
- Call IMFAttributes::LockStore to prevent another thread from adding or deleting attributes.
- Call IMFAttributes::GetCount to find the number of attributes.
- Call GetItemByIndex to get each attribute by index.
- Call IMFAttributes::UnlockStore to unlock the attribute store.
- Windows XP with Service Pack 2 (SP2) and later.
- Windows XP Media Center Edition 2005 with KB900325 (Windows XP Media Center Edition 2005) and KB925766 (October 2006 Update Rollup for Windows XP Media Center Edition) installed.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | mfobjects.h (include Mfidl.h) |
Library | Mfuuid.lib |