Directory Services

IDsDisplaySpecifier::GetDisplaySpecifier

The IDsDisplaySpecifier::GetDisplaySpecifier method binds to the display specifier object for a given class in Active Directory®.

HRESULT GetDisplaySpecifier( 
  LPCWSTR pszObjectClass,
  REFIID riid,
  void** ppv
);

Parameters

pszObjectClass
[in] Pointer to a null-terminated Unicode string that contains the name of the object class to retrieve the display specifier for.
riid
[in] Contains the interface identifier of the desired interface.
ppv
[in, out] Pointer to an interface pointer that receives the display specifier of the object class.

Return Values

Returns a standard HRESULT value including the following.
Return Code Description
S_OK The method was successful.
E_NOINTERFACE The specified interface identifier is not supported.
E_INVALIDARG One or more parameters are invalid.

Remarks

This method uses the ADsOpenObject function to bind to the display specifier object of the given class. If that fails, it attempts to bind to the display specifier in the user locale. If this fails again, it binds to the display specifier in the default locale.

This method uses the server and user credentials set by a previous call to IDsDisplaySpecifier::SetServer.

Example Code [C++]

The following code example demonstrates how to call this method.

HRESULT hr;
IDsDisplaySpecifier *pDS;

hr = CoCreateInstance(CLSID_DsDisplaySpecifier,
						NULL,
						CLSCTX_INPROC_SERVER,
						IID_IDsDisplaySpecifier,
						(void**)&pDS);
if(SUCCEEDED(hr))
{
	IADs *pads;

	hr = pDS->GetDisplaySpecifier(L"user", IID_IADs, (LPVOID*)&pads);

	if(SUCCEEDED(hr))
	{
		pads->Release();
}

	pDS->Release();
}

Requirements

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

ADsOpenObject, IDsDisplaySpecifier::SetServer, IDsDisplaySpecifier, Active Directory Display Interfaces