Metodo IModelObject::EnumerateRawValues (dbgmodel.h)
Il metodo EnumerateRawValues enumera tutti gli elementi figlio 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 specifica il comportamento della ricerca del costrutto nativo.
enumerator
Enumeratore che enumererà ogni elemento figlio nativo del tipo specificato dall'argomento kind come interfaccia IRawEnumerator.
Valore restituito
Questo metodo restituisce HRESULT che indica l'esito positivo o negativo.
Osservazioni
esempio di codice
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
}
Fabbisogno
Requisito | Valore |
---|---|
intestazione | dbgmodel.h |