CompA.H
资源名称:COM 原理与应用.rar [点击查看]
上传用户:biuytresa
上传日期:2007-12-07
资源大小:721k
文件大小:1k
源码类别:
DNA
开发平台:
Visual C++
- #ifndef __CompA_H__
- #define __CompA_H__
- #ifndef __ISomeInterface_H__
- #include "SomeIFace.h"
- #endif
- class INondelegatingUnknown
- {
- public:
- virtual HRESULT __stdcall NondelegationQueryInterface(const IID& iid, void **ppv) = 0 ;
- virtual ULONG __stdcall NondelegatingAddRef() = 0;
- virtual ULONG __stdcall NondelegationRelease() = 0;
- };
- class CA : public ISomeInterface, public INondelegatingUnknown
- {
- protected:
- ULONG m_Ref;
- public:
- CA(IUnknown *pUnknownOuter);
- ~CA();
- public :
- // Delegating IUnknown
- virtual HRESULT __stdcall QueryInterface(const IID& iid, void **ppv) ;
- virtual ULONG __stdcall AddRef() ;
- virtual ULONG __stdcall Release() ;
- // Nondelegating IUnknown
- virtual HRESULT __stdcall NondelegationQueryInterface(const IID& iid, void **ppv);
- virtual ULONG __stdcall NondelegatingAddRef();
- virtual ULONG __stdcall NondelegationRelease();
- virtual HRESULT __stdcall SomeFunction( ) ;
- private :
- IUnknown *m_pUnknownOuter; // pointer to outer IUnknown
- };
- #endif __CompA_H__