Microsoft DirectX 8.0

IComponentTypes Interface

The ComponentTypes object enables applications to enumerate, add, remove and retrieve individual ComponentType objects. All ComponentTypes objects also support IPersistPropertyBag.

MethodNameDescription
get_CountReturns the number of Component Types in the collection.
get__NewEnumEnumeration method to support For...Each loops in Automation clients.
EnumComponentTypesReturns an IEnumComponentTypes enumerator for all component types in the collection.
get_ItemRetrieves the IComponentType interface pointer at the specified index number.
put_ItemReplaces the ComponentType object at the specified index with a new ComponentType object.
AddAdds a new ComponentType object to the collection.
RemoveRemoves the ComponentType object at the specified index number.
CloneCreates a new copy of the collection.

IComponentTypes::Clone

IComponentTypes Interface

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.

IComponentTypes::get_Count

IComponentTypes 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.

IComponentTypes::get__NewEnum

IComponentTypes 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.

IComponentTypes::EnumComponentTypes

IComponentTypes Interface

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.

IComponentTypes::get_Item

IComponentTypes 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.

IComponentTypes::put_Item

IComponentTypes 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.

IComponentTypes::Add

IComponentTypes 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.

IComponentTypes::Remove

IComponentTypes 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.