IComponent::QueryDataObject

[This is preliminary documentation and subject to change.]

Returns a data object that can be used to retrieve context information for the specified cookie.

HRESULT QueryDataObject(
  long cookie,             // unique identifier
  DATA_OBJECT_TYPES type,  // type of the data object
  LPDATAOBJECT * ppDataObject  // pointer to address of the object
);
 

Parameters

cookie
[in] Specifies the unique identifier for which the data object is required. When called for virtual list items, which don't have cookies, this parameter is set to the item's list index.
type
[in] Specifies the data object as one of the following:
Value Meaning
CCT_SCOPE = 0x8000 Data object for the scope pane.
CCT_RESULT = 0x8001 Data object for the result pane.
CCT_SNAPIN_MANAGER = 0x8002 Data object for the Snap-in Manager context.
CCT_UNITIALIZED = 0xFFFF Data object has an invalid type.

These constants are members of the DATA_OBJECT_TYPES enumeration.

ppDataObject
[out] Pointer to the address of the returned data object.

Return Values

S_OK
The data object was successfully returned.
E_UNEXPECTED
An unexpected error occurred.
E_INVALIDARG
One or more parameters are invalid.

Remarks

These data objects can be passed to the same snap-in or to extension snap-ins that require them. Some of the MMC interfaces that may use this data object are IComponent, IComponentData, IContextMenuProvider, IExtendContextMenu, IPropertySheetProvider, and IExtendPropertySheet.

See Also

IComponent, IComponentData::QueryDataObject, IDataObject