ITargetObjectCol::Remove

Meta Data Services Programming

Meta Data Services Programming

ITargetObjectCol::Remove

This method removes the specified object from the collection. The exact behavior of this method depends on whether the relationship collection is an origin collection or a destination collection.

If the relationship collection is an origin collection, this method deletes the versioned relationship.

If the relationship collection is a destination collection, this method first performs object-version resolution to yield a single target-object version, and then it removes that target-object version from the relationship's TargetVersions collection.

HRESULT Remove( VARIANT    sItem
);

Parameters

sItem

[in]
Identifies the item to be retrieved from the collection. This parameter can be the index, the name, or the object identifier of the item.

Return Value

S_OK

The method completed successfully.

Error Values

This method failed to complete successfully.

Remarks

An object can be removed by name only if it is the destination object of a naming relationship.

If the source is the origin, the origin version must be unfrozen.

If the relationship is a destination relationship, and the resolution strategy yields a target object version that is frozen, this method fails.

Removal from a sequenced collection does not update the collection sequence order.

See Also

ITargetObjectCol Interface

Resolution Strategy for Objects and Object Versions