Condividi tramite


IDebugExpression2:: EvaluateAsync

Questo metodo restituisce l'espressione in modo asincrono.

HRESULT EvaluateAsync ( 
   EVALFLAGS             dwFlags,
   IDebugEventCallback2* pExprCallback
);
int EvaluateAsync(
   enum_EVALFLAGS       dwFlags, 
   IDebugEventCallback2 pExprCallback
);

Parametri

  • dwFlags
    [in] Una combinazione di flag EVALFLAGS dall'enumerazione che controllano la valutazione di espressioni.

  • pExprCallback
    [in] questo parametro è sempre un valore null.

Valore restituito

Se l'operazione riesce, restituisce S_OK; in caso contrario restituisce un codice di errore. Un codice di errore tipico è:

delle modifiche a..."

Descrizione

E_EVALUATE_BUSY_WITH_EVALUATION

Un'altra espressione viene attualmente valutazione e la valutazione simultanea dell'espressione non è supportata.

Note

Questo metodo deve restituire immediatamente dopo che ha avviato la valutazione di espressioni. Quando l'espressione correttamente viene valutata, IDebugExpressionEvaluationCompleteEvent2 deve essere IDebugEventCallback2 inviato al callback dell'evento come fornito IDebugProgram2:: Connessione tramite o IDebugEngine2:: Connessione.

Esempio

Nell'esempio seguente viene illustrato come implementare questo metodo per un oggetto semplice di CExpression che implementa IDebugExpression2 l'interfaccia.

HRESULT CExpression::EvaluateAsync(EVALFLAGS dwFlags,
                                   IDebugEventCallback2* pExprCallback)
{
    // Set the aborted state to FALSE
    // in case the user tries to redo the evaluation after aborting.
    m_bAborted = FALSE;
    // Post the WM_EVAL_EXPR message in the message queue of the current thread.
    // This starts the expression evaluation on a background thread.
    PostThreadMessage(GetCurrentThreadId(), WM_EVAL_EXPR, 0, (LPARAM) this);
    return S_OK;
}

Vedere anche

Riferimenti

IDebugExpression2

IDebugExpressionEvaluationCompleteEvent2

EVALFLAGS

IDebugEventCallback2