Platform SDK: Active Directory, ADSI, and Directory Services

IADsCollection::Add

The IADsCollection::Add method adds a named item to the collection.

HRESULT IADsCollection::Add(
  BSTR bstrName,  
  VARIANT varItem 
);

Parameters

bstrName
[in] Name of the item. IADsCollection::GetObject and IADsCollection::Remove reference the item by this name.
varItem
[in] Value of the item. When the item is an object, this parameter holds the IDispatch interface pointer on the object.

Return Values

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

S_OK
The named item has been successfully added.
E_NOTIMPL
The method is not supported.

For other return values, see ADSI Error Codes.

Remarks

Collections for a directory service can also consist of a set of immutable objects.

This method is not supported in any of the ADSI system providers.

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.

See Also

IADsCollection::GetObject, IADsCollection::Remove, ADSI Error Codes, ADSI system providers, IDispatch