Microsoft DirectX 8.0 |
The ComponentTypes object enables applications to enumerate, add, remove and retrieve individual ComponentType objects. All ComponentTypes objects also support IPersistPropertyBag.
MethodName Description get_Count Returns the number of Component Types in the collection. get__NewEnum Enumeration method to support For...Each loops in Automation clients. EnumComponentTypes Returns an IEnumComponentTypes enumerator for all component types in the collection. get_Item Retrieves the IComponentType interface pointer at the specified index number. put_Item Replaces the ComponentType object at the specified index with a new ComponentType object. Add Adds a new ComponentType object to the collection. Remove Removes the ComponentType object at the specified index number. Clone Creates a new copy of the collection.
Creates a new copy of the collection.
Syntax
HRESULT Clone( IComponentTypes** NewList );
Parameters
- NewList
- [out, retval] Address of an IComponentTypes interface pointer that will be set to the new ComponentTypes object.
Return Value
Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.
Returns the number of Component Types in the collection.
Syntax
HRESULT get_Count( long* Count );
Parameters
- Count
- [out, retval] Pointer to a variable of type long that will receive the number of items in the collection.
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 a interface pointer to an IEnumVARIANT object that will receive the new collection.
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 IEnumComponentTypes enumerator for all component types in the collection.
Syntax
HRESULT EnumComponentTypes( IEnumComponentTypes** ppNewEnum );
Parameters
- ppNewEnum
- [out, retval] Address of an IEnumComponentTypes interface pointer that will receive the new collection.
Return Value
Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.
Retrieves the IComponentType interface pointer at the specified index number.
Syntax
HRESULT get_Item( VARIANT Index, IComponentType** ppComponentType );
Parameters
- Index
- [in] The index number of the object to retrieve.
- ppComponentType
- [out, retval] Address of an IComponentType interface pointer that will be set to the 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.
Replaces the ComponentType object at the specified index with a new ComponentType object.
Syntax
HRESULT put_Item( VARIANT Index, IComponentType* ComponentType );
Parameters
- Index
- [in] Index number of the item to be replaced.
- ComponentType
- [in] Pointer to the IComponentType object that will be inserted into the collection.
Return Value
Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.
Adds a new ComponentType object to the collection.
Syntax
HRESULT Add( IComponentType* ComponentType, VARIANT* NewIndex );
Parameters
- ComponentType
- [in] Pointer to the IComponentType object that will be added to the collection.
- NewIndex
- [out, retval] The index number of the ComponentType after it has been added to the collection.
Return Value
Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.
Removes the ComponentType object at the specified index number.
Syntax
HRESULT Remove( VARIANT Index );
Parameters
- Index
- [in] Index of the item to remove.
Return Value
Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.