Share via


IExpressionEval::LoadExpr Method [C++]

Use this method to pre-compile an expression, and if successful, load the expression into the expression cache.

Definition

[C++]

HRESULT IExpressionEval::LoadExpr(longnExprID);

[Visual Basic]

Sub LoadExpr(nExprID As Long)

Parameters

  • nExprID[C++]
    [in] A positive long that contains the identifier of the expression to load into the expression cache.
  • nExprID[Visual Basic]
    [in] A positive Long that contains the identifier of the expression to load into the expression cache.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] None.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_EXPR_BADARGTYPE [C++] 0x81100018

[Visual Basic] &H81100018

Argument data type info missing from expression, or unrecognized argument data type encountered in expression
E_EXPR_BADARGVALUE [C++] 0x81100022

[Visual Basic] &H81100022

Invalid expression argument value, or impossible conversion
E_EXPR_BADCLAUSE [C++] 0x81100016

[Visual Basic] &H81100016

Invalid clause encountered
E_EXPR_BADCONNECTION [C++] 0x8110001F

[Visual Basic] &H8110001F

Invalid connection
E_EXPR_BADEXPRID [C++] 0x8110000A

[Visual Basic] &H8110000A

Invalid expression ID specified
E_EXPR_BADOPER [C++] 0x81100017

[Visual Basic] &H81100017

Operator missing, unrecognized operator encountered, or type mismatch
E_EXPR_BADTERM [C++] 0x81100015

[Visual Basic] &H81100015

Term type missing, or unrecognized term type encountered
E_EXPR_BADXML [C++] 0x81100014

[Visual Basic] &H81100014

An unrecognized XML element was encountered
E_EXPR_NOCONNECTIONSTRING [C++] 0x8110000D

[Visual Basic] &H8110000D

No connection string specified
E_EXPR_NOTFOUND [C++] 0x81100012

[Visual Basic] &H81100012

Could not find the specified expression ID, nExprID, in the expression store
E_EXPR_XMLPARSE [C++] 0x81100013

[Visual Basic] &H81100013

XML DOM object parsing error

[C++] Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic] Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

If the specified expression is already loaded in the expression cache at the time of the call, it will be reloaded.

The LoadExpr method increments the read-only ExprCount property by one when it loads an expression into the expression cache.

With the exception of XML fragments, only expressions that exist in the expression cache may be evaluated. The Eval method loads an expression from the expression store that is not preloaded into the expression cache.

Use the LoadAll method to load all expressions into the expression cache. Use the FlushExpr method to remove an expression from the expression cache.

The Connect method must be called before using the LoadExpr method.

See Also

[C++]ExpressionEval Object

[C++]IExpressionEval::Connect

[C++]IExpressionEval::get_ExprCount

[C++]IExpressionEval::FlushAll

[C++]IExpressionEval::FlushExpr

[C++]IExpressionEval::LoadAll

[Visual Basic]ExpressionEval Object

[Visual Basic]ExpressionEval.Connect

[Visual Basic]ExpressionEval.ExprCount

[Visual Basic]ExpressionEval.FlushAll

[Visual Basic]ExpressionEval.FlushExpr

[Visual Basic]ExpressionEval.LoadAll

Copyright © 2005 Microsoft Corporation.
All rights reserved.