This topic has not yet been rated - Rate this topic

IFunctionInstanceCollectionQuery::AddQueryConstraint method

[Function Discovery is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

The AddQueryConstraint method adds a query constraint to the query.

This method enables the application to filter the result set to only those instances that fulfill this constraint.

Syntax


HRESULT AddQueryConstraint(
  [in]  const WCHAR *pszConstraintName,
  [in]  const WCHAR *pszConstraintValue
);

Parameters

pszConstraintName [in]

The query constraint.

pszConstraintValue [in]

The constraint value.

Return value

Possible return values include, but are not limited to, the following.

Return codeDescription
S_OK

The method completed successfully.

E_OUTOFMEMORY

The method is unable to allocate the memory required to perform this operation.

 

Remarks

If multiple constraints are added, all constraints must be supported to satisfy the query.

AddQueryConstraint will fail with an error if the IFunctionInstanceCollectionQuery object includes all subcategories and the AddQueryConstraint method is called with the pszConstraintName parameter set to FD_QUERYCONSTRAINT_PROVIDERINSTANCEID. To avoid this error, create a IFunctionInstanceCollectionQuery object that does not include all subcategories. You can create such an object by calling CreateInstanceCollectionQuery with the fIncludeAllSubCategories parameter set to false.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

FunctionDiscoveryAPI.h

IDL

FunctionDiscoveryAPI.idl

DLL

FunDisc.dll

See also

Constraint Definitions
IFunctionInstanceCollectionQuery
Function Discovery Queries

 

 

Send comments about this topic to Microsoft

Build date: 10/26/2012

Community Additions

ADD
© 2013 Microsoft. All rights reserved.