IConditionFactory2::CreateNegation method (structuredquery.h)

Creates a condition node that is a logical negation (NOT) of another condition (a subnode of this node).

Syntax

HRESULT CreateNegation(
  [in]  ICondition                 *pcSub,
  [in]  CONDITION_CREATION_OPTIONS cco,
  [in]  REFIID                     riid,
  [out] void                       **ppv
);

Parameters

[in] pcSub

Type: ICondition*

A pointer to the ICondition subnode to be negated. For default options, use the CONDITION_CREATION_DEFAULT flag.

[in] cco

Type: CONDITION_CREATION_OPTIONS

The condition creation operation of the leaf condition as the CONDITION_CREATION_OPTIONS enumeration.

[in] riid

Type: REFIID

The desired IID of the enumerating interface: either IEnumUnknown, IEnumVARIANT, or (for a negation condition) IID_ICondition.

[out] ppv

Type: void**

Receives a pointer to zero or more ICondition and ICondition2 objects.

Return value

Type: HRESULT

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

Remarks

Logically simplifying a condition node usually results in a smaller, more easily traversed and processed condition tree. For example, if pcSub is itself a negation condition with a subcondition C, then the double negation is logically resolved, and ppcResult is set to C. Without simplification, the resulting tree would look like NOT — NOT — C.

Applications that need to execute queries based on the condition tree would typically benefit from setting this parameter to TRUE.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header structuredquery.h

See also

CONDITION_CREATION_OPTIONS

CONDITION_OPERATION

CONDITION_TYPE

ICondition

ICondition2

IConditionFactory

IConditionFactory2

Reference