Metodo IModelObject::EnumerateRawValues (dbgmodel.h)

Il metodo EnumerateRawValues enumera tutti i figli nativi (ad esempio campi, classi di base e così via) dell'oggetto specificato.

Sintassi

HRESULT EnumerateRawValues(
  SymbolKind     kind,
  ULONG          searchFlags,
  IRawEnumerator **enumerator
);

Parametri

kind

Indica il tipo di simbolo nativo da recuperare (ad esempio, una classe di base o un membro dati)

searchFlags

Set facoltativo di flag che specificano il comportamento della ricerca del costrutto nativo.

enumerator

Enumeratore che enumererà ogni figlio nativo del tipo specificato dall'argomento tipo come interfaccia IRawEnumerator .

Valore restituito

Questo metodo restituisce HRESULT che indica l'esito positivo o l'errore.

Commenti

Codice di esempio

ComPtr<IModelObject> spMessage; /* get a tagMSG */

ComPtr<IRawEnumerator> spEnum;
if (SUCCEEDED(spMessage->EnumerateRawValues(SymbolField, RawSearchNone, &spEnum)))
{
    HRESULT hr = S_OK;
    while (SUCCEEDED(hr))
    {
        BSTR fieldName;
        SymbolKind symKind;
        ComPtr<IModelObject> spFieldValue;
        hr = spEnum->GetNext(&fieldName, &symbolKind, &spFieldValue);
        if (SUCCEEDED(hr))
        {
            // fieldName contains the name of the field, symKind contains the kind of 
            // symbol matched (SymbolField in this case), spFieldValue contains the value
            // For tagMSG (with symbols), the enumerator should produce field names and 
            // values for 'hwnd', 'message', 'wParam', 'lParam', 'time', and 'pt'
            SysFreeString(fieldName);
        }
    }

    // hr == E_BOUNDS : We hit the end of the enumerator
    // hr == E_ABORT  : There was a user request for an interrupt / propagate that upward immediately
}

Requisiti

Requisito Valore
Intestazione dbgmodel.h

Vedi anche

Interfaccia IModelObject