IMFCollection::GetElement Method

Retrieves an object in the collection.

Syntax

public:
HRESULT GetElement(
         DWORD dwElementIndex,
         IUnknown **ppUnkElement
)  

Parameters

dwElementIndex
Type: DWORD 

Zero-based index of the object to retrieve. Objects are indexed in the order in which they were added to the collection.

ppUnkElement
Type: IUnknown **

[out, optional] Receives a pointer to the object’s IUnknown interface. The caller must release the interface. The retrieved pointer value might be NULL.

Return value

Type: HRESULT 

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Refer to Media Foundation return codes.

Remarks

This method does not remove the object from the collection. To remove an object, call IMFCollection::RemoveElement.

Requirements

Header: Declared in mfobjects.h (include mfidl.h).

Library: Use mfuuid.lib.