IADsContainer::GetObject

Gets the IADs interface of the Active Directory object in this container identified by the object's schema class and relative name.

HRESULT IADsContainer::GetObject(
  BSTR bstrClass,        //Schema class of the object
  BSTR bstrRelativeName, //Relative name of the object
  IDispatch ** ppNamedObject  //Interface to use on the object
);
 

Parameter

bstrClass
[in] Name of the object as it is known in the underlying directory and identical to the one retrieved through the IADs::get_Name method. If the class name is NULL, the provider returns the first item found in the container.
bstrRelativeName
[in] Name of the object as it is known in the underlying directory and identical to the one retrieved through the IADs::get_Name method.
ppNamedObject
[out] Indirect pointer to the IDispatch interface on the specified object.

Return Values

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

S_OK
The interface pointer on the specified object in this container has been successfully retrieved.

Remarks

This is the most common way of retrieving an interface pointer on an Active Directory object.

Notes to Implementers

If the schema class name is not provided, retrieve an interface pointer on the first object found in the container with the specified name.

QuickInfo

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

See Also

ADsGetObject