Condividi tramite


Metodo IADsPropertyList::Next (iads.h)

Il metodo IADsPropertyList::Next ottiene l'elemento successivo nell'elenco delle proprietà. L'elemento restituito è un oggetto Entry proprietà.

Sintassi

HRESULT Next(
  [out] VARIANT *pVariant
);

Parametri

[out] pVariant

Indirizzo di una variabile allocata dal chiamante contenente il valore dell'elemento successivo nell'elenco delle proprietà. Il valore restituito di VT_DISPATCH fa riferimento a un puntatore dell'interfaccia IDispatch a un oggetto che implementa l'interfaccia IADsPropertyEntry .

Valore restituito

Questo metodo supporta i valori HRESULT standard, inclusi S_OK se l'elemento viene ottenuto. Quando viene restituito l'ultimo elemento nell'elenco, il valore restituito restituito sarà diverso a seconda del provider usato. I codici seguenti vengono usati per indicare che l'ultimo elemento nell'elenco è stato ottenuto:

Per altre informazioni e altri valori restituiti, vedere Codici di errore ADSI.

Commenti

È necessario cancellare pVariant usando VariantClear quando il valore restituito dal metodo Next non è più necessario.

Esempio

Nell'esempio di codice seguente viene illustrato come esaminare un elenco di proprietà usando il metodo Next .

Dim propList As IADsPropertyList
Dim v as Variant
Dim propVal As IADsPropertyValue
 
On Error Resume Next
 
Set propList = GetObject("LDAP://dc01/DC=Fabrikam,DC=com")
 
propList.GetInfo
Set v = propList.Next()
While (Not (IsNull(v)) And Err.Number = 0)
    Set propEnty = v
    Debug.Print v.Name
    Debug.Print v.AdsType
    
    Set v = propList.Next    
Wend

Nell'esempio di codice C++ seguente viene illustrato come usare il metodo IADsPropertyList::Next .

////////////////////////////////////
// Function used to retrieve an entry using the 
// IADsPropertyList::Next method.
 
//     name: GetNextEntry
//    input: IADsPropertyList*
//   return: IADsPropertyEntry
//     uses: IADsPropertyList::Next
/////////////////////////////////////////////////////////
IADsPropertyEntry* GetNextEntry(IADsPropertyList* pList)
{
    VARIANT var;
    VariantInit(&var);
    IADsPropertyEntry *pEntry;

    if(!pList)
    {
        _tprintf("An error has occurred.");
        return NULL;
    }
 
    HRESULT hr = pList->Next(&var);
    hr = V_DISPATCH(&var)->QueryInterface(IID_IADsPropertyEntry,
                                         (void**)&pEntry);
    VariantClear(&var);
    return pEntry;
}

Requisiti

   
Client minimo supportato Windows Vista
Server minimo supportato Windows Server 2008
Piattaforma di destinazione Windows
Intestazione iads.h
DLL Activeds.dll

Vedi anche

Codici di errore ADSI

IADsPropertyEntry

IADsPropertyList

Metodi di proprietà IADsPropertyList

Idispatch