Microsoft DirectX 8.0 |
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.
MethodName Description get_Count Gets the number of Component objects in the collection. get__NewEnum Enumeration method to support For...Each loops in Automation clients. EnumComponents Returns an IEnumComponents enumerator for all components in the collection. get_Item Enables the caller to access a component by index. Add Adds a Component object to the collection. Remove Removes a Component object from the collection. Clone Creates a new copy of the collection.
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.
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.
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.
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.
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.
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.
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.