IResultOwnerData

[This is preliminary documentation and subject to change.]

IResultOwnerData supports the use of virtual lists, which is a List View control that has the LVS_OWNERDATA style set. The methods of this interface are applicable only to virtual lists. This is an optional interface and snap-ins may implement it for enhanced virtual list performance.

Virtual lists support large numbers of list items, up to 100,000,000. This is possible because the virtual list control does not provide the storage. All storage requirements are provided by the owner of the items. When the control needs information about an item, it sends a LVN_GETDISPINFO notification to the owner of the item parameters.

Because of the lack of storage, a List View control in virtual mode does not support all of the messages that it supports in normal mode.

Result View Selection
To select a virtual list view, IComponent::GetResultViewType sets a flag in the ViewOptions parameter. Setting the MMC_VIEW_OPTIONS_OWNERDATALIST flag and returning a value of S_FALSE makes the result pane a virtual list.

Controlling a Virtual List
Result pane lists are controlled through the IResultData interface. When a virtual list is selected, only a subset of the interface methods can be used. Of these, some have restrictions and or different interpretations of calling parameters when applied to virtual lists.

The following table summarizes the changes to IResultData methods:

Method Support Modification
InsertItem (LPRESULTDATAITEM item)
    Not supported
None
DeleteItem (ITEM itemID, int nCol)
    Modified - Pass item index rather than itemID
Modified Pass item index instead of itemID
FindItemByLParam (LPARAM lParam, ITEM *pItemID) None
DeleteAllRsltItems () Same
SetItem (LPRESULTDATAITEM item) None
GetItem (LPRESULTDATAITEM item) Modified Must use item index and set iItemID = 0. Can only get select, focus states
GetNextItem (LPRESULTDATAITEM item) Modified Can only test for select and focus state. Only returns item index, not lParam
ModifyItemState (int nIndex, ITEM itemID, UINT uAdd, UINT uRemove) Modified Must use nIndex and set iItemID = 0. Only focus and select states can be modified
ModifyViewStyle (MMC_RESULT_VIEW_STYLE add, MMC_RESULT_VIEW_STYLE remove) Same
SetViewMode (long lViewMode) Same
GetViewMode (long* LviewMode) Same
UpdateItem (ITEM itemID) Modified Pass item index rather than itemID
Sort (long lUserParam) Modified Calls IResultOwnerData::SortItems instead of IResultDataCompare::Compare
SetDescBarText (LPOLESTR DescText) Same

IResultData::SetItemCount sets the number of items in a virtual list.

Supporting the Virtual List
A virtual list calls IComponent::GetDisplayInfo to get the information needed to display an item in the result pane. When called for a virtual list, the itemID and lParam fields of the RESULTDATAITEM structure will be zero. The snap-in must use the nIndex field (item index) to identify the item for which data is being requested.

The virtual list calls IComponent::QueryDataObject to get a data object for a particular result item. When called for a virtual list, no itemID will be available, so the cookie parameter will be the item index.

Note that IResultDataCompare cannot be used with virtual lists because it does not support item sorting.

When to Implement

This interface is implemented by the snap-in in order to support virtual lists.

When to Use

TBD

Methods in Vtable Order

IUnknown Methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

IResultOwnerData Methods Description
IResultOwnerData::FindItem Finds result items matching the specified string.
IResultOwnerData::CacheHint Pre-collects range information allowing for possible optimizations.
IResultOwnerData::SortItems

See Also

IResultData, IResultData::SetItemCount, IComponent::GetDisplayInfo, IComponent::QueryDataObject, IComponent::GetResultViewType, RESULTDATAITEM