IADsCollection::Add

Add a named item to this ADSI collection.

HRESULT IADsCollection::Add(
  BSTR bstrName,  //Name of item
  VARIANT varItem //Item to add to the collection
);
 

Parameter

bstrName
[in] Name of the item. IADsCollection::GetObject and IADsCollection::Remove reference the item by this name.
varItem
[in] Value of the item.

Return Values

This method supports the standard return values E_FAIL and E_UNEXPECTED, as well as the following:

S_OK
The named item has been successfully added.

Remarks

Collections for a directory service can also consist of a set of objects that cannot be changed.

Notes to Implementers

Collections that do not support direct addition of new items must return E_NOTIMPL.

QuickInfo

  Windows NT: Use version 4.0 and later.
  Windows CE: Unsupported.
  Header: Declared in iads.h.

See Also

IADsCollection::Remove