IDebugExpression2::EvaluateAsync

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

This method evaluates the expression asynchronously.

int EvaluateAsync(  
   enum_EVALFLAGS       dwFlags,   
   IDebugEventCallback2 pExprCallback  
);  

Parameters

dwFlags
[in] A combination of flags from the EVALFLAGS enumeration that control expression evaluation.

pExprCallback
[in] This parameter is always a null value.

If successful, returns S_OK; otherwise returns an error code. A typical error code is:

ErrorDescription
E_EVALUATE_BUSY_WITH_EVALUATIONAnother expression is currently being evaluated, and simultaneous expression evaluation is not supported.

This method should return immediately after it has started the expression evaluation. When the expression is successfully evaluated, an IDebugExpressionEvaluationCompleteEvent2 must be sent to the IDebugEventCallback2 event callback as supplied through Attach or Attach.

The following example shows how to implement this method for a simple CExpression object that implements the IDebugExpression2 interface.

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;  
}  

IDebugExpression2
IDebugExpressionEvaluationCompleteEvent2
EVALFLAGS
IDebugEventCallback2

Show: