ITuningSpaceContainer::TuningSpacesForName 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 TuningSpacesForName method retrieves a collection of tuning spaces that match the specified name.

Syntax

HRESULT TuningSpacesForName(
  [in]  BSTR          Name,
  [out] ITuningSpaces **NewColl
);

Parameters

[in] Name

String that contains a regular expression to match against either the friendly name or the unique name of the tuning space.

[out] NewColl

Address of variable that receives an ITuningSpaces interface pointer. Use this interface to enumerate the collection. The caller must release the interface.

Return value

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

Remarks

The returned collection might be empty, if no tuning spaces match the name.

Examples


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

// Try to match any tuning spaces named "Local (something) Cable".
CComPtr<ITuningSpaces> pTunes;
CComBSTR bstrName("Local.*Cable");
hr = pITuningSpaceContainer->TuningSpacesForName(bstrName, &pTunes);
if (SUCCEEDED(hr))
{
    // Find the size of the returned collection.
    long cCount = 0;
    hr = pTunes->get_Count(&cCount);
    if (SUCCEEDED(hr) && (cCount > 0))
    {
        // Enumerate the collection.
        CComPtr<IEnumTuningSpaces> pTuneEnum;
        hr = pTunes->get_EnumTuningSpaces(&pTuneEnum);
        if (SUCCEEDED(hr))
        {
            // Use IEnumTuningSpaces to iterate through the collection.
        }
    }
}

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