Compartir a través de


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

El método EnumerateRawValues enumera todos los elementos secundarios nativos (por ejemplo: campos, clases base, etc.) del objeto especificado.

Sintaxis

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

Parámetros

kind

Indica el tipo de símbolo nativo que se va a capturar (por ejemplo: una clase base o un miembro de datos).

searchFlags

Un conjunto opcional de marcas que especifica el comportamiento de la búsqueda de la construcción nativa.

enumerator

Enumerador que enumerará todos los elementos secundarios nativos del tipo especificados por el argumento kind como una interfaz IRawEnumerator.

Valor devuelto

Este método devuelve HRESULT que indica éxito o error.

Observaciones

de ejemplo de código de

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
encabezado de dbgmodel.h

Consulte también

interfaz IModelObject