IConditionFactory::MakeAndOr method

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

Syntax


HRESULT MakeAndOr(
  [in]          CONDITION_TYPE ct,
  [in]          IEnumUnknown   *peuSubs,
  [in]          BOOL           fSimplify,
  [out, retval] ICondition     **ppcResult
);

Parameters

ct [in]

Type: CONDITION_TYPE

The CONDITION_TYPE of the condition node. The CONDITION_TYPE must be either CT_AND_CONDITION or CT_OR_CONDITION.

peuSubs [in]

Type: IEnumUnknown*

A pointer to an enumeration of ICondition objects, or NULL for an empty enumeration.

fSimplify [in]

Type: BOOL

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]

Type: ICondition**

Receives the address of a pointer to the new ICondition node.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

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.

Requirements

Minimum supported client

Windows XP with SP2, Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 with SP1 [desktop apps only]

Redistributable

Windows Desktop Search (WDS) 3.0

Header

Structuredquery.h

IDL

Structuredquery.idl

See also

Reference
IConditionFactory
CONDITION_TYPE
CONDITION_OPERATION
IConditionFactory2
ICondition
ICondition2

 

 

Show: