Share via


ITuningSpaceContainer::get_Item Method

The get_Item method retrieves a tuning space with the specified ID.

Syntax

HRESULT get_Item(
  [in]   VARIANT varIndex,
  [out]  ITuningSpace **ppTuningSpace
);

Parameters

  • varIndex [in]
    VARIANT that specifies the ID of the tuning space.

  • ppTuningSpace [out]
    Address of an ITuningSpace interface pointer that will be set to the returned interface.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

Tuning spaces are identified by ID number. The ID number is unique within the collection. The range of valid IDs is not guaranteed to be contiguous; there may be holes if tuning spaces are added and then removed.

Examples

CComPtr <ITuningSpaceContainer>  pTuningSpaceContainer;
// Create the SystemTuningSpaces object (not shown).

long cCount = 0;
long ID = 1; // zero is not a valid ID.
hr = pTuningSpaceContainer->get_Count(&cCount);
if (SUCCEEDED(hr))
{
    while (cCount)
    {
        CComPtr<ITuningSpace> pTuningSpace;
        CComVariant varIndex(ID);
        hr = pITuningSpaceContainer->get_Item(varIndex, &pTuningSpace);
        if (SUCCEEDED(hr))
        {
             // pTuningSpace now points to the tuning space with this ID.
             --cCount;
        }
        ID++; // incremement for the next ID.
    }
}

Requirements

Header Declared in Dshow.h.
DLL Requires Quartz.dll.

See Also

ITuningSpaceContainer Interface

Send comments about this topic to Microsoft

Build date: 12/4/2008