IFunctionInstanceCollectionQuery::AddQueryConstraint method (functiondiscoveryapi.h)
[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.
HRESULT AddQueryConstraint( [in] const WCHAR *pszConstraintName, [in] const WCHAR *pszConstraintValue );
The query constraint.
The constraint value.
Possible return values include, but are not limited to, the following.
||The method completed successfully.|
||The method is unable to allocate the memory required to perform this operation.|
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.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|