Directory Services |
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 );
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. |
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.
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(); }
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Header: Declared in Dsclient.h.
ADsOpenObject, IDsDisplaySpecifier::SetServer, IDsDisplaySpecifier, Active Directory Display Interfaces