Share via


IMLPropertySet (Compact 7)

3/12/2014

This interface contains methods to get and set property values as a set.

Methods

In addition to the methods inherited from IUnknown, this interface contains the following methods.

Remarks

The property set created by this interface can be used to insert or update items in the Media Library. This interface can be used to enumerate a list of properties based on index or property ID. It can also be used to set or retrieve the properties of a media item.

Obtaining a Pointer

This interface is created in the call to IMLFactory::CreateMLPropertSet.

Code Example

The following example code shows how to retrieve results from a query.

Important

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

// Iterate through the results of a query and retrieve the properties
for(ULONG iResult = 0; iResult < cResults; iResult++)
{
    IMLPropertySet  *pResultProps = NULL;
    ULONG          cProps = 0;
    BSTR             bstrTitle = NULL;
    BSTR             bstrURL = NULL;
    LONG            width = 0;
    LONG            height = 0;
    MLDateTime   dtFile;

    hr = pQuery->GetResultByIndex(iResult, &pResultProps);

    if (pResultProps)
    {
        // Get the specific properties that should be
        // in the result set
        hr = pResultProps->GetBSTR(x_PROP_photo_title, &bstrTitle);
        hr = pResultProps->GetBSTR(x_PROP_photo_fileURL, &bstrURL);
        hr = pResultProps->GetLONG(x_PROP_photo_height, &height);
        hr = pResultProps->GetLONG(x_PROP_photo_width, &width);
        hr = pResultProps->GetDATE(x_PROP_photo_fileTime, &dtFile);
 
        // Do something with the resulting values 
       // that are contained in bstrTitle, bstrURL, height,
        // width, dtFile here 
        // ...

        // Cleanup
        SysFreeString(bstrTitle);
        SysFreeString(bstrURL);

        // Release the interface retrieved by GetResultByIndex
        pResultProps->Release();
    }
}

Requirements

Header

mlibdll.h,
mlibdll.idl

Library

mlibdll.lib

See Also

Reference

Media Library Interfaces