CGenericObserverNotifier.h
资源名称:rnso.zip [点击查看]
上传用户:lianquan
上传日期:2007-01-02
资源大小:197k
文件大小:1k
源码类别:
ActiveX/DCOM/ATL
开发平台:
Visual C++
- //
- // CGenericObserverNotifier.h
- //
- #ifndef CGenericObserverNotifier_H_
- #define CGenericObserverNotifier_H_
- #include "..RnsoSupportCCriticalArray.h"
- #include "..RnsoSupportObserverNotification.h"
- #include "..RnsoSupportRnsoNotificationRout.h"
- class AFX_EXT_CLASS CGenericObserverNotifier:
- public CComObjectRootEx<CComMultiThreadModel>,
- public IDispatchImpl<IGenericObserverNotification,&IID_IGenericObserverNotification,&LIBID_RNSOLib>
- {
- public:
- HANDLE m_hThread;
- void FinalRelease( );
- HRESULT FinalConstruct( );
- BOOL m_bContinueToRun ;
- CEvent m_evtStartStopThread;
- CEvent m_evtStopThread;
- CEvent m_evtNotification;
- CCriticalArray<CNotificationFromManager*,CNotificationFromManager*> m_apNotifications;
- RnsoNotificationRout * m_pRouter;
- static DWORD _stdcall ThreadStarter( LPVOID lpParam ) ;
- DWORD ThreadProc();
- void NotificationMessage(CNotificationFromManager * pNotification);
- void OnNotifyNOTIFY(ObserverNotification* pNotification);
- void OnNotifyNOTIFY_SUBJECTBROKEN(DWORD dwSubjectID);
- RnsoNotificationRout * SetNotificationRout(RnsoNotificationRout * pRout);
- CGenericObserverNotifier() {m_pRouter=NULL;}
- BEGIN_COM_MAP(CGenericObserverNotifier)
- COM_INTERFACE_ENTRY(IUnknown)
- COM_INTERFACE_ENTRY(IGenericObserverNotification)
- END_COM_MAP()
- STDMETHOD(OnNotify)(DWORD dwSenderSubject,LONG nSize,byte * pBytes);
- STDMETHOD(OnNotifySubjectBroken)(DWORD dwSubjectID);
- };
- #endif