In Active Directory, bind to an object given its path and primary interface identifier (IID).
HRESULT ADsGetObject(
LPWSTR lpszPathName, //The ADsPath name of the object
REFIID riid, //IID of primary interface
VOID ** ppObject //Interface on that object
);
This method supports the standard return values E_FAIL and E_UNEXPECTED, as well as the following:
The ADsGetObject helper function is called by the C/C++ client to bind to an Active Directory object. Like Visual Basic's internal GetObject() function, ADsGetObject takes as input a display name and returns a pointer to the requested interface.
Windows NT: Use version 4.0 and later.
Windows CE: Unsupported.