| Platform SDK: Active Directory, ADSI, and Directory Services |
The property methods of the IADsNamespaces interface get and set the properties described in the following table. For general discussions of property methods, see Interface Property Methods.
| Property | Description |
|---|---|
| DefaultContainer
[Visual Basic] [C++] |
The DefaultContainer property is an ADsPath name that identifies a base container object to which you can bind. This base container provides the starting point from which user begins browsing. ADSI defines the DefaultContainer property to provide a quick way of getting a pointer to a previously defined ADSI container object. Providers need to supply this property on a "per-user" basis. The default container is set immediately after the invocation of IADsNamespaces::put_DefaultContainer. SetInfo does not have to be called. In fact, the system-supplied namespaces object returns E_NOTIMPL for the SetInfo method called on this object. |
When a container is the namespaces object, an enumeration operation always results in a list of provider-specific namespace objects. When IADsContainer::GetObject is used to obtain a namespace object, the bstrClass parameter will be ignored. This is because the container, that is, the namespaces object, contains only one type of objects, namely, provider-specific namespace objects.
The following Visual Basic code snippet shows how to set the default container of the namespaces object.
Dim ns as IADsNamespaces
Set ns = GetObject("ADs:")
ns.DefaultContainer = "WinNT://Fabrikam/Sales"
'do other stuff
The following C++ code snippet shows how to set the default container of the namespaces object.
IADsNamespaces *pNs;
HRESULT hr;
hr = ADsGetObject(L"ADs:",
IID_IADsNamespaces,
(void**)pNs);
VARIANT var;
VariantInit(&var);
V_BSTR(&var) = SysAllocString(L"WinNT://Fabrikam/Sales");
V_VT(&var) = VT_BSTR;
pNs->put_DefaultContainer(var);
VariantClear(&var);
// Do other stuff