Share via


IMLQuery::AddResultID (Compact 7)

3/12/2014

This method adds a Media Library property ID to the query results list.

Syntax

HRESULT AddResultID(
  ULONG propertyID
);

Parameters

  • propertyID
    [in] ID of a property that is included in the results set for a query.

Return Values

Returns the HRESULT values shown in the following table.

Value Description

S_OK

The method was successful.

E_INVALIDARG

One or more parameters are invalid.

E_FAIL

The method was not successful.

E_MEMORY

An out of memory error occurred.

Remarks

By default, no properties are included in the property set (IMLPropertySet) that is returned by IMLQuery::GetResultByIndex. Only those properties specifically requested by the IMLQuery::AddResultID method are returned in the property set.

Code Example

The example code below shows you how to build a query and add results to the property set.

Important

For readability, the following code example does not contain security or error handlings. Do not use the following code in a production environment.

IMLQuery       pQuery;
IMLPropertySet pPropSet;

//Create the query and propety set objects
g_MLFactory->CreateMLQuery(&pQuery);
g_MLFactory->CreateMLPropertySet(&pPropSet);

// Create a query using the properties
pQuery->AndLONG(mlid_PhotoHeight, GT, 1);
pQuery->AndLONG(mlid_PhotoHeight, LT, 4096);
    
// Specify the number of results to return
pQuery->SetMAXResultsCount(10);

// Add a list of properties to the result list
pQuery->AddResultID(mlid_PhotoTitle);
pQuery->AddResultID(mlid_PhotoHeight);
pQuery->AddResultID(mlid_PhotoWidth);
pQuery->AddResultID(mlid_PhotoFileSize);
pQuery->AddResultID(mlid_PhotoFileURL);
pQuery->AddResultID(mlid_PhotoFileTime);

Requirements

Header

mlibdll.h,
mlibdll.idl

Library

mlibdll.lib

See Also

Reference

IMLQuery