IDebugControl3::Evaluate method

The Evaluate method evaluates an expression, returning the result.

Syntax

HRESULT Evaluate(
  PCSTR        Expression,
  ULONG        DesiredType,
  PDEBUG_VALUE Value,
  PULONG       RemainderIndex
);

Parameters

Expression

Specifies the expression to be evaluated.

DesiredType

Specifies the desired return type. Possible values are described in DEBUG_VALUE; with the addition of DEBUG_VALUE_INVALID, which indicates that the return type should be the expression's natural type.

Value

Receives the value of the expression.

RemainderIndex

Receives the index of the first character of the expression not used in the evaluation. If RemainderIndex is NULL, this information isn't returned.

Return Value

This method may also return other error values. See Return Values for more details.

Return code Description
S_OK
The method was successful.
E_FAIL
An error occurred while evaluating the expression. For example, there was a syntax error, an undefined variable, or a division by zero exception.

Remarks

Expressions are evaluated by the current expression evaluator. The engine contains multiple expression evaluators; each supports a different syntax. The current expression evaluator can be chosen by using SetExpressionSyntax.

For details of the available expression evaluators and their syntaxes, see Numerical Expression Syntax.

If an error occurs while evaluating the expression, returning E_FAIL, the RemainderIndex variable can be used to determine approximately where in the expression the error occurred.

Requirements

   
Target Platform Desktop
Header dbgeng.h (include Dbgeng.h)

See Also

GetExpressionSyntax

IDebugControl

IDebugControl2

IDebugControl3

SetExpressionSyntax

SetExpressionSyntaxByName