#pragma once #include #include #include #include #include #include #include class CPGEnumString : public IEnumString { public: CPGEnumString(); CPGEnumString(const std::list& asList); CPGEnumString(const std::vector& asList); ~CPGEnumString(); private: std::list m_asList; ULONG m_nCurrentElement; LONG m_cRef; public: // IUnknown Interface ULONG STDMETHODCALLTYPE AddRef(); ULONG STDMETHODCALLTYPE Release(); HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); // IEnumString Interface HRESULT STDMETHODCALLTYPE Clone(IEnumString **ppenum); HRESULT STDMETHODCALLTYPE Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched); HRESULT STDMETHODCALLTYPE Reset(); HRESULT STDMETHODCALLTYPE Skip(ULONG celt); // CPGEnumString Interface HRESULT STDMETHODCALLTYPE AddItem(std::wstring lpszItem); HRESULT STDMETHODCALLTYPE AddItem(LPCWSTR lpszItem); HRESULT STDMETHODCALLTYPE SetList(const std::vector& asList); HRESULT STDMETHODCALLTYPE SetList(const std::list& asList); HRESULT STDMETHODCALLTYPE RemoveList(); };