00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _hypstd_unknwn_h_
00029 #define _hypstd_unknwn_h_
00030
00031
00032 class CUnknown :
00033 public INondelegatingUnknown
00034 {
00035 public:
00036 CUnknown(IUnknown*);
00037 virtual ~CUnknown();
00038
00040
00041 virtual com_result NondelegatingQueryInterface(const hypIID&, void**);
00042 virtual t_ulong NondelegatingAddRef();
00043 virtual t_ulong NondelegatingRelease();
00045
00049 virtual com_result Init() {
00050 return com_ok;
00051 }
00052 virtual void FinalRelease();
00053
00057 inline static long ActiveComponents() {
00058 return ms_cActiveComponents;
00059 }
00060
00061 com_result FinishQI(IUnknown*, void**);
00062
00063 protected:
00067 inline IUnknown* GetOuterUnknown() const {
00068 return m_pUnknownOuter;
00069 }
00070
00071 long m_cRef;
00072 IUnknown* m_pUnknownOuter;
00073 static long ms_cActiveComponents;
00074 };
00075
00076
00081 #define hyp_DECLARE_IUNKNOWN \
00082 virtual hyp::ker::com_result QueryInterface(const hyp::ker::hypIID & iid, void** ppv) {\
00083 return GetOuterUnknown()->QueryInterface(iid,ppv); \
00084 } \
00085 virtual hyp::t_ulong AddRef() { \
00086 return GetOuterUnknown()->AddRef(); \
00087 } \
00088 virtual hyp::t_ulong Release() { \
00089 return GetOuterUnknown()->Release(); \
00090 }
00091
00092
00093 #endif