我又灌<br><br>IComponent<br>[This is preliminary documentation and subject to change.] <br><br>The IComponent interface enables the Microsoft&reg; Management Console to communicate with snap-in components. Similar to the IComponentData interface, IComponent is typically implemented at the view level and is closely associated with items being displayed in the result pane.<br><br>When to Implement<br>Implement the IComponent interface in your in-process (in-proc) server DLL to communicate with the console,.which displays the result pane and enumerates the items it contains.<br><br>When to Use<br>Your snap-in component must expose the IComponent interface if it enumerates items in the result pane because the snap-in cannot enumerate without it. Extension snap-ins that do not extend the namespace (but extend other features like context menus, toolbars, and so on) do not need to implement this interface or the IComponentData interface.<br><br>Methods in Vtable Order<br>IUnknown Methods Description <br>QueryInterface Returns pointers to supported interfaces. <br>AddRef Increments reference count. <br>Release Decrements reference count. <br><br>IComponent Methods Description <br>Initialize Provides an entry point to the console. <br>Notify Called by the console to notify the snap-in of actions taken by a user. <br>Destroy Releases all references to the console. <br>QueryDataObject Returns a data object that can be used to retrieve context information for the specified cookie. <br>GetResultViewType Determines what the result pane view should be. <br>GetDisplayInfo Retrieves display information about an item in the result pane. <br>CompareObjects Enables a snap-in to compare two data objects acquired through QueryDataObject. Note that data objects can be acquired from two different instances of IComponent. <br><br><br> <br>