ITargetObjectCol::Add
This method is used to add a new item to an object collection, when the sequencing of objects in the collection is not important. An interface pointer for the new relationship is passed back to the caller.
HRESULT Add(
IDispatch *plReposObj,
BSTR Name,
IRelationship **pplRelship
);
Parameters
*plReposObj
[in]
The repository object version to be added to the collection.
Name
[in]
The name to be assigned to the object that is being added to the collection.
*pplRelship
[out]
The newly added object's relationship interface pointer.
Return Value
S_OK
The method completed successfully.
This method failed to complete successfully.
Remarks
Objects may only be added to a collection when the collection's source object is also the collection's origin object.
When you call this method, the origin version must be unfrozen.
You can use this method to create a new versioned relationship between the source object version and a version of the target object. You cannot use it to enlarge a versioned relationship. If the source object version already has a relationship to any version of the target object, this method will fail. You can include another version of the target object in the versioned relationship by adding an item to the versioned relationship's TargetObjects collection.
The value of plReposObj is the specific version of the target object.