# IRfPreferencesFn Interface Reference

Inherits IRsObject.

List of all members.

## Public Member Functions
HRESULT | GetPreferenceSpace ([out, retval] IRnEncapsulator **ppPreferenceSpace)
HRESULT | AddPrefItem ([in] IID *pItemClassId,[out] IRsNode **ppItem)
HRESULT | AddPrefItemFromPrototype ([in] BSTR bszFileName,[out] IRsNode **ppItem)

## Detailed Description

Function set for working with preferences.

## Member Function Documentation

HRESULT IRfPreferencesFn::GetPreferenceSpace | ( | [out, retval] IRnEncapsulator ** | ppPreferenceSpace | ) |

Searches preferences encapsulator.

Returns:
  ppPreferenceSpace [out,retval] interface to preference encapsulator .

HRESULT IRfPreferencesFn::AddPrefItem | ( | [in] IID * | pItemClassId,
|  | [out] IRsNode ** | ppItem |
| ) |  |  |

Creates preference item node based on class id.

- Adds it to preference encapsulator.

Parameters:

  | pItemClassId | [in] class id of node.
  | ppItem | [out] interface to node representing new preference item.

        spPreferencesFn->AddPrefItem(DEF_GUIDNAME_PTR(IRnAnimPreferences), ppNode);

HRESULT IRfPreferencesFn::AddPrefItemFromPrototype | ( | [in] BSTR | bszFileName,
|  | [out] IRsNode ** | ppItem |
| ) |  |  |

Creates preference item node from the prototype :

- Saved in preobject directory.
- Adds it to preference encapsulator.

Parameters:

  | bszFileName | [in] name of file located in preobject directory .
  | ppItem | [out] interface to node representing new preference item.

     CComBSTR bszFileName;
     bszFileName.Append(L"AnimPref.rsobj");
     if(FAILED(hRes = spPreferencesFn->AddPrefItemFromPrototype(bszFileName, ppNode)))
      return spPreferencesFn->AddPrefItem(DEF_GUIDNAME_PTR(IRnAnimPreferences), ppNode);