Implementing the IComponent Interface

[This is preliminary documentation and subject to change.]

Every snap-in that enumerates items in the result pane must implement IComponent. Similar to IComponentData, this is one of the console's interfaces to the snap-in and is closely associated with the functionality of the items displayed in the result pane.

Among the IComponent methods, Initialize provides an entry point for the snap-in by allowing QueryInterface calls to IConsole. Notify is called by the console to notify the snap-in component that an event has occurred as a result of a user action. Destroy releases all interfaces to the console such as IConsole.

QueryDataObject returns a pointer to a data object that can be used to retrieve context information for a specified cookie. The data object type is taken from the DATA_OBJECT_TYPES enumeration and is used to determine the context in which someone is asking for the data object. A CCT_SCOPE flag is set to indicate that the data object is for the scope pane. CCT_RESULT is set to indicate it is for the result view pane. Another constant, CCT_UNITIALIZED indicates that the data object has an invalid type.

As noted earlier, IConsole is the snap-in's interface to the console, and objects with the IDataObject interface on them are used to pass context information from the snap-in to the console. IDataObject is documented in the Platform SDK.

GetResultViewType returns the result view type for a particular cookie that determines what the result pane control should be. This could be the default list view, an OCX (an ActiveX control) CLSID string, or a URL path. The GetDisplayInfo method retrieves display information for an item in the result pane. CompareObjects provides a way for a snap-in component to compare two result-view pane items.