次の方法で共有


IWMPQuery::addCondition method (wmp.h)

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The addCondition method adds a condition to the compound query using AND logic.

Syntax

HRESULT addCondition(
  [in] BSTR bstrAttribute,
  [in] BSTR bstrOperator,
  [in] BSTR bstrValue
);

Parameters

[in] bstrAttribute

String containing the attribute name.

[in] bstrOperator

String containing the operator. See Remarks for supported values.

[in] bstrValue

String containing the attribute value.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.

Remarks

Conditions contained in a compound query are organized into condition groups. Multiple conditions within a condition group are always concatenated by using AND logic. Condition groups are always concatenated to each other by using OR logic. To start a new condition group, call IWMPQuery::beginNextGroup.

Compound queries using IWMPQuery are not case sensitive.

A list of values for the bstrAttribute parameter can be found in the Alphabetical Attribute Reference section.

The following table lists the supported values for bstrOperator.

String Applies To
BeginsWith Strings
Contains Strings
Equals All types
GreaterThan Numbers, Dates
GreaterThanOrEquals Numbers, Dates
LessThan Numbers, Dates
LessThanOrEquals Numbers, Dates
NotBeginsWith Strings
NotContains Strings
NotEquals All types
 

Windows Media Player 10 Mobile: This method is not supported.

Requirements

Requirement Value
Minimum supported client Windows Media Player 11.
Target Platform Windows
Header wmp.h
DLL Wmp.dll

See also

Alphabetical Attribute Reference

IWMPMediaCollection2::createQuery

IWMPMediaCollection2::getPlaylistByQuery

IWMPMediaCollection2::getStringCollectionByQuery

IWMPQuery Interface