59 lines
1.1 KiB
C++
59 lines
1.1 KiB
C++
// CEventHandler.h
|
|
|
|
#ifndef __EVNET_HANDLER_H__
|
|
#define __EVNET_HANDLER_H__
|
|
|
|
#include <atlbase.h>
|
|
#include <atlcom.h>
|
|
|
|
class IEventHandler
|
|
{
|
|
public:
|
|
virtual void Received() = 0;
|
|
};
|
|
|
|
|
|
class CEventHandlerSysDib : public IDispEventImpl<
|
|
0,
|
|
CEventHandlerSysDib,
|
|
&CpSysDib::DIID__ISysDibEvents,
|
|
&CpSysDib::IID_ISysDib,
|
|
1,
|
|
0>
|
|
{
|
|
public:
|
|
void SetIEventHandler(IEventHandler* pIEventHandler);
|
|
|
|
void __stdcall Received();
|
|
|
|
BEGIN_SINK_MAP(CEventHandlerSysDib)
|
|
SINK_ENTRY_EX(0, CpSysDib::DIID__ISysDibEvents, 0x01, Received)
|
|
END_SINK_MAP()
|
|
|
|
protected:
|
|
IEventHandler* m_pIEventHandler;
|
|
};
|
|
|
|
class CEventHandlerDib : public IDispEventImpl<
|
|
0,
|
|
CEventHandlerDib,
|
|
&__uuidof(CpDib::_IDibEvents),
|
|
&__uuidof(CpDib::IDib),
|
|
1,
|
|
0>
|
|
{
|
|
public:
|
|
void SetIEventHandler(IEventHandler* pIEventHandler);
|
|
|
|
void __stdcall Received();
|
|
|
|
BEGIN_SINK_MAP(CEventHandlerDib)
|
|
SINK_ENTRY_EX(0, __uuidof(CpDib::_IDibEvents), 0x01, Received)
|
|
END_SINK_MAP()
|
|
|
|
protected:
|
|
IEventHandler* m_pIEventHandler;
|
|
};
|
|
|
|
#endif /* __EVNET_HANDLER_H__ */
|