COMP.H

///////////////////////////////////////////////////////////////////////////// 
// comp.h : IComponent Interface to communicate with MMC for results pane use
//
// This is a part of the MMC SDK.
// Copyright (C) 1997 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// MMC SDK Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// MMC Library product.
//

#ifndef __COMP_H_
#define __COMP_H_

#include <mmc.h>


/////////////////////////////////////////////////////////////////////////////
// CComponent - This class at this point is the basic interface to handle
// anything to do with the results pane. At this point it is
// mostly a stib place holder and serves no real purpose. It will
// get filled in and used in later steps.

class CComponent:
public IComponent,
public CComObjectRoot
{
public:

// ATL Maps
DECLARE_NOT_AGGREGATABLE(CComponent)

BEGIN_COM_MAP(CComponent)
COM_INTERFACE_ENTRY(IComponent)
END_COM_MAP()


CComponent();
~CComponent();

void SetIComponentData(CComponentData* pData);


// IComponent interface members
//
STDMETHOD(Initialize)(LPCONSOLE lpConsole);
STDMETHOD(Notify)(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, long arg, long param);
STDMETHOD(Destroy)(long cookie);
STDMETHOD(GetResultViewType)(long cookie, LPOLESTR* ppViewType, long* pViewOptions);
STDMETHOD(QueryDataObject)(long cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject);
STDMETHOD(GetDisplayInfo)(RESULTDATAITEM* pResultDataItem);
STDMETHOD(CompareObjects)(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB);

private:
LPCONSOLE m_ipConsole; // MMC interface to console
IHeaderCtrl* m_ipHeaderCtrl; // MMC interface to header control
IResultData* m_ipResultData; // MMC interface to result data
IConsoleVerb* m_ipConsoleVerb; // MMC interface to console verb
LPIMAGELIST m_ipImageResult; // MMC interface to result pane images
ULONG m_cRefs; // object refcount
CComponentData* m_pCompData; // Parent scope pane object
HBITMAP m_hbmp16x16;
HBITMAP m_hbmp32x32;

private:
HRESULT OnShow(LPDATAOBJECT pDataObject, long arg, long param);
HRESULT OnSelect(LPDATAOBJECT pDataObject, long arg, long param);
HRESULT OnAddImages(LPDATAOBJECT pDataObject, long arg, long param);
HRESULT OnRefresh(LPDATAOBJECT pDataObject, long arg, long param);
};

#endif // __COMP_H_