次の方法で共有


IADsPropertyList プロパティ メソッド

IADsPropertyList インターフェイスのプロパティ メソッドは、次の表に示すプロパティを読み取ります。 詳細については、「インターフェイス プロパティ メソッド」を参照してください

プロパティ

PropertyCount

プロパティ リスト内の項目の数。

アクセスの種類: 読み取り専用

スクリプト データ型: LONG

// C++ method syntax
HRESULT get_PropertyCount(
  [out] LONG* plCount
);

次のコード例は、プロパティ リスト内の項目の数を決定する方法を示しています。

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

次のコード例は、プロパティ リスト内の項目の数を決定する方法を示しています。

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;
    }

}

要件

要件 Value
サポートされている最小のクライアント
Windows Vista
サポートされている最小のサーバー
Windows Server 2008
ヘッダー
Iads.h
[DLL]
Activeds.dll
IID
IID_IADsPropertyListは、C6F602B6-8F69-11D0-8528-00C04FD8D503 として定義されます。

関連項目

IADsPropertyList

Interface プロパティ メソッド