IConditionFactory::MakeAndOr Method

Creates a condition node that is a logical conjunction (AND) or disjunction (OR) of a collection of subconditions.

Syntax

HRESULT MakeAndOr(      
    CONDITION_TYPE ct,
    IEnumUnknown *peuSubs,
    BOOL fSimplify,
    ICondition **ppcResult
);

Parameters

  • ct
    [in] The CONDITION_TYPE of the condition node. The CONDITION_TYPE must be either CT_AND_CONDITION or CT_OR_CONDITION.

  • peuSubs
    [in] A pointer to an enumeration of ICondition objects, or NULL for an empty enumeration.

  • fSimplify
    [in] TRUE to logically simplify the result, if possible; then the result will not necessarily to be of the specified kind. FALSE if the result should have exactly the prescribed structure.

    An application that plans to execute a query based on the condition tree would typically benefit from setting this parameter to TRUE.

  • ppcResult
    [out, retval] Receives the address of a pointer to the new ICondition node.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

There are no special condition trees for TRUE and FALSE. However, a condition tree consisting of an AND node with no subconditions is always TRUE, and a condition tree consisting of an OR node with no subconditions is always FALSE.

See Also

IConditionFactory, CONDITION_TYPE, CONDITION_OPERATION, IConditionFactory2, ICondition, ICondition2