Partilhar via


Método IModelObject::EnumerateRawValues (dbgmodel.h)

O método EnumerateRawValues enumera todas as crianças nativas (por exemplo: campos, classes base etc...) do objeto fornecido.

Sintaxe

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

Parâmetros

kind

Indica o tipo de símbolo nativo a ser buscado (por exemplo: uma classe base ou um membro de dados)

searchFlags

Um conjunto opcional de sinalizadores que especifica o comportamento da pesquisa para o constructo nativo.

enumerator

Um enumerador que enumerará cada filho nativo do tipo especificado pelo argumento tipo como uma interface IRawEnumerator.

Valor de retorno

Esse método retorna HRESULT que indica êxito ou falha.

Observações

de exemplo de código

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
}

Requisitos

Requisito Valor
cabeçalho dbgmodel.h

Consulte também

interface IModelObject