Platform SDK: Active Directory, ADSI, and Directory Services

IADsPathname::SetDisplayType

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

HRESULT IADsPathname::SetDisplayType(
  long lnDisplayType
);

Parameters

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

Return Values

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

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 snippet sets to display the path name 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 snippet sets to display the path name 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 snippet sets to display the path with both the naming attributes and values. See the code snippet in IADsPathname for the GetPathnameObject function.

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

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

IADsPathname, ADS_DISPLAY_ENUM, ADSI Error Codes