Platform SDK: Active Directory, ADSI, and Directory Services |
The IADsPathname::AddLeafElement method adds an element to the end of the directory path already set on the Pathname object.
HRESULT IADsPathname::AddLeafElement( BSTR bstrLeafElement );
This method supports the standard return values, as well as the following:
For other return values, see ADSI Error Codes.
The following Visual Basic® code snippet adds the "com" element to "dc=dom,dc=company".
Dim x As New Pathname x.Set "LDAP://srv1/dc=dom,dc=company", ADS_SETTYPE_FULL x.AddLeafElement("dc=com")
The following VBScript code snippet adds the "com" element to "dc=dom,dc=company".
Dim x Const ADS_SETTYPE_FULL = 1 Set x = CreateObject("Pathname") x.Set "LDAP://srv1/dc=dom,dc=company", ADS_SETTYPE_FULL x.AddLeafElement("dc=com")
The following C++ code snippet shows the effect produced by calling the IADsPathname::AddLeafElement.
LPWSTR adsPath=L"LDAP://server/dc=Microsoft,dc=com"; IADsPathname *pPath = GetPathnameObject(adsPath); HRESULT hr = pPath->AddLeafElement(L"cn=jsmith"); pPath->Release();
Now the pathname becomes "LDAP://server/cn=jsmith,dc=Microsoft,dc=com".
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.