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.
- IMLPropertySet::Count
Returns the number of properties in the set.
- IMLPropertySet::IsWritable
Returns a value indicating whether the property set is writable.
- IMLPropertySet::GetIDByIndex
Returns the property ID for the specified index.
- IMLPropertySet::GetTypeByIndex
Returns the property type for the property at the specified index.
- IMLPropertySet::GetValid
Returns a value indicating whether the specified property is valid in the property set.
- IMLPropertySet::GetBOOL
Returns the value of a Boolean property.
- IMLPropertySet::SetBOOL
Sets the value of a Boolean property.
- IMLPropertySet::GetSHORT
Returns the value of a short property.
- IMLPropertySet::SetSHORT
Sets the value of a short property.
- IMLPropertySet::GetLONG
Returns the value of a long property.
- IMLPropertySet::SetLONG
Sets the value of a long property.
- IMLPropertySet::GetLONGLONG
Returns the value of a long long property.
- IMLPropertySet::SetLONGLONG
Sets the value of a long long property.
- IMLPropertySet::GetDate
Returns the value of an MLDateTime property.
- IMLPropertySet::SetDate
Sets the value of an MLDateTime property.
- IMLPropertySet::GetBSTR
Returns the value of a string property.
- IMLPropertySet::SetBSTR
Sets the value of a string property.
- IMLPropertySet::GetSTRING
Returns a string property.
- IMLPropertySet::SetSTRING
Sets a string property.
- IMLPropertySet::HasID
Determines if a property ID is contained within the IMLPropertySet.
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, |
Library |
mlibdll.lib |