Microsoft DirectX 8.0

IComponents Interface

A "component" in the context of digital television refers to a substream within the program stream. For example, a program stream may have three audio streams in different languages; in this case each audio stream is a "component" of the program stream. The IComponents interface is implemented on the Components object, which is a collection of Component objects. The Components object enables applications to enumerate components within a program stream and perform operations related to individual components in the collection. All Components objects also support IPersistPropertyBag.

MethodNameDescription
get_CountGets the number of Component objects in the collection.
get__NewEnumEnumeration method to support For...Each loops in Automation clients.
EnumComponentsReturns an IEnumComponents enumerator for all components in the collection.
get_ItemEnables the caller to access a component by index.
AddAdds a Component object to the collection.
RemoveRemoves a Component object from the collection.
CloneCreates a new copy of the collection.

IComponents::get_Count

IComponents Interface

Gets the number of Component objects in the collection.

Syntax

HRESULT get_Count(
    long* Count
    );

Parameters

Count
[out, retval] Pointer to a variable of type long that receives the number of Components.

Return Value

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

IComponents::get__NewEnum

IComponents Interface

Enumeration method to support For...Each loops in Automation clients.

Syntax

HRESULT get__NewEnum(
    IEnumVARIANT** ppNewEnum
    );

Parameters

ppNewEnum
[out, retval] Address of an IEnumVARIANT interface pointer that will receive the enumeration.

Return Value

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

Remarks

This method is provided to enable scripting and VB applications to iterate through the collection in a For...Each loop. C++ applications should use the EnumComponents method.

IComponents::EnumComponents

IComponents Interface

Returns an IEnumComponents enumerator for all components in the collection.

Syntax

HRESULT EnumComponents(
    IEnumComponents** ppNewEnum
    );

Parameters

ppNewEnum
[out, retval] Address of an IEnumComponents interface pointer that will receive the new enumeration.

Return Value

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

IComponents::get_Item

IComponents Interface

Enables the caller to access a component by index.

Syntax

HRESULT get_Item(
    VARIANT Index,
    IComponent** ppComponent
    );

Parameters

Index
[in] Variable of type VARIANT specifying the zero-based index in the collection.
ppComponent
[out, retval] Address of an IComponent interface pointer that will receive the Component object at the specified index.

Return Value

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

IComponents::Add

IComponents Interface

Adds a Component object to the collection.

Syntax

HRESULT Add(
    IComponent* Component,
    VARIANT* NewIndex
    );

Parameters

Component
[in] Pointer to the Component object to be added.
NewIndex
[out, retval] Pointer to a VARIANT that will receive the index of the Component after it has been added.

Return Value

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

IComponents::Remove

IComponents Interface

Removes a Component object from the collection.

Syntax

HRESULT Remove(
    VARIANT Index
    );

Parameters

Index
[in] Variable of type VARIANT that specifies the index number of the Component to be removed.

Return Value

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

IComponents::Clone

IComponents Interface

Creates a new copy of the collection.

Syntax

HRESULT Clone(
    IComponents** NewList
    );

Parameters

NewList
[out, retval] Address of an IComponents interface pointer that will be set to the new Components object.

Return Value

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