PROPBAG.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:1k
源码类别:

Windows编程

开发平台:

Visual C++

  1. class CPropertyBagItem :
  2.    public CObject
  3. {
  4.    DECLARE_DYNAMIC( CPropertyBagItem );
  5. public:
  6.    CPropertyBagItem( LPCOLESTR pszName, VARIANT* pvarValue );
  7. public:
  8.    CString m_strName;
  9.    COleVariant m_varValue;
  10. };
  11. typedef CTypedPtrList< CObList, CPropertyBagItem* > CPropertyBagItemList;
  12. class CPropertyBag :
  13.    public IPropertyBag
  14. {
  15. public:
  16.    CPropertyBag();
  17.    ~CPropertyBag();
  18.    POSITION GetFirstItemPosition() const;
  19.    CPropertyBagItem* GetNextItem( POSITION& posItem ) const;
  20. // IUnknown
  21. public:
  22.    STDMETHOD_( ULONG, AddRef )();
  23.    STDMETHOD_( ULONG, Release )();
  24.    STDMETHOD( QueryInterface )( REFIID iid, void** ppInterface );
  25. // IPropertyBag
  26. public:
  27.    STDMETHOD( Read )( LPCOLESTR pszPropName, VARIANT* pvarValue,
  28.   IErrorLog* pErrorLog );
  29.    STDMETHOD( Write )( LPCOLESTR pszPropName, VARIANT* pvarValue );
  30. protected:
  31.    ULONG m_nRefCount;
  32.    CPropertyBagItemList m_lpItems;
  33. };