Directory Services


The IDsDisplaySpecifier::GetFriendlyAttributeName method retrieves from the localized name of an attribute of a given object class.

HRESULT GetFriendlyAttributeName( 
  LPCWSTR pszObjectClass,
  LPCWSTR pszAttributeName,
  LPWSTR pszBuffer,
  UINT cchBuffer


[in] Pointer to a null-terminated Unicode string that contains the name of the object class to obtain the localized attribute name for. Examples of the object class name are "user" and "container".
[in] Pointer to a null-terminated Unicode string that contains the name of the attribute to obtain the localized name for.
[in] Pointer to a wide character buffer that receives the name string. This buffer must be at least cchBuffer wide characters in length.
[in] Contains the size of the pszBuffer buffer, in wide characters, including the terminating NULL character. If the name exceeds this number of characters, the name is truncated.

Return Values

Returns a standard HRESULT value, including the following.
Return Code Description
S_OK The method was successful.
E_FAIL An unspecified error occurred.
E_INVALIDARG One or more parameters are invalid.


This method looks up the display specifier of the class to check the attributeNames property for an attribute name pair that matches the given attribute name. If no match is found, the input attribute name is returned.


Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Header: Declared in Dsclient.h.

See Also

Active Directory Display Interfaces, IDsDisplaySpecifier