Share via


ITuningSpaceContainer::get_Item method (tuner.h)

[The feature associated with this page, Microsoft TV Technologies, is a legacy feature. Microsoft strongly recommends that new code does not use this feature.]

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

Syntax

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

Parameters

[in] varIndex

VARIANT that specifies the ID of the tuning space.

[out] TuningSpace

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++; // increment for the next ID.
    }
}


Requirements

Requirement Value
Minimum supported client Windows�XP [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header tuner.h

See also

ITuningSpaceContainer Interface