Microsoft DirectX 8.1 (C++)

IObjects::get_AddNew

This topic applies to Windows XP Home Edition and Windows XP Professional only.

The get_AddNew method creates a new object and adds it to the collection.

Syntax

HRESULT get_AddNew(
  IUnknown**  ppunk
);

Parameters

ppunk

[out]  Address of a variable to receive a pointer to the IUnknown interface of the new object.

Return Values

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.
E_OUTOFMEMORY There was not sufficient memory to create a new object.
E_POINTER Data cannot be read from or written to a supplied address.

Remarks

The object is of the type appropriate to the parent collection. If the collection is a generic Objects collection, the new object supports only the IUnknown interface. However, the object can have metaproperties which are retrieved by using IGuideStore::get_MetaPropertiesOf. The object can also be involved in relationships with other objects.

This method is valid only for collections retrieved by using IGuideStore::get_Objects or IObjects::get_ItemsWithType.

See Also