Directory Services

IADsPathname::SetDisplayType

The IADsPathname::SetDisplayType method specifies how to display the path of an object. It can query for the path to be displayed in a string with both naming attributes and values, that is, "CN=Jeff Smith" or with values only, that is, "Jeff Smith".

HRESULT SetDisplayType( 
  long lnDisplayType
);

Parameters

lnDisplayType
The display type of a path as defined in ADS_DISPLAY_ENUM.

Return Values

This method supports the standard return values, including the following:

Return Code Description
S_OK The specified display type is valid and has been set successfully.
E_FAIL The specified display type cannot be set.

Example Code [Visual Basic]

The following Visual Basic code example sets to display the path in a string with both the naming attribute and the value.

Dim x As New Pathname
 
x.SetDisplayType(ADS_DISPLAY_FULL)

Example Code [VBScript]

The following VBScript code example sets to display the path in a string with both the naming attribute and the value.

Dim x 
const ADS_DISPLAY_FULL = 1
Set x = CreateObject("Pathname")
x.SetDisplayType(ADS_DISPLAY_FULL)

Example Code [C++]

The following C++ code example sets to display the path with both the naming attributes and values. For more information, see the code example for the GetPathnameObject function in IADsPathname.

LPWSTR adsPath=L"LDAP://server/cn=jeffsmith,dc=Fabrikam,dc=com";
 
IADsPathname *pPath = GetPathnameObject(adsPath);
 
pPath->SetDisplayType(ADS_DISPLAY_FULL)

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.

See Also

IADsPathname, ADS_DISPLAY_ENUM, ADSI Error Codes