Directory Services |
The property methods of the IADsPropertyList interface read the properties described in the following table. For more information, see Interface Property Methods.
Property | Description |
---|---|
PropertyCount
[Visual Basic] [C++] |
The number of items in the property list. |
The following code example shows how to determine number of items in a property list.
Dim propList As IADsPropertyList Dim count As Long On Error GoTo Cleanup Set propList = GetObject("LDAP://dc01/DC=Fabrikam,DC=com") propList.GetInfo count = propList.PropertyCount Debug.Print "Number of Properties Found: " & count Cleanup: If (Err.Number<>0) Then MsgBox("An error has occurred. " & Err.Number) End If Set propList = Nothing
The following code example shows how to determine number of items in a property list.
int GetPropertyCacheCount(LPWSTR adsPath) { IADsPropertyList *pList; IADs *pObj; HRESULT hr = S_OK; if(!adsPath) { _tprintf(TEXT("Invalid ADsPath.")); return -1; } HRESULT hr = ADsGetObject(adsPath, IID_IADsPropertyList, (void**)&pList); // Initialize the property cache. hr = pList->QueryInterface(IID_IADs,(void**)&pObj); pObj->GetInfo(); pObj->Release(); // Get the property count. hr = pList->get_PropertyCount(&count); pList->Release(); // Return the property count if it succeeded, otherwise // return -1. if(SUCCEEDED(hr)) { return count; } else { return -1; } }
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.