Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.9 KiB

  1. //=--------------------------------------------------------------------------=
  2. // StrColl.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1995-1997 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // contains the definitions for the various string collections we'll use
  13. //
  14. #ifndef _STRCOLL_H_
  15. #include "CommDlgInterfaces.H"
  16. //=--------------------------------------------------------------------------=
  17. // the CStringsCollection class basically works with a safearray to expose the
  18. // collection, and uses the safearray functions to maniplate it.
  19. //=--------------------------------------------------------------------------=
  20. // NOTES: 9.95 - this collection assumes that the safearray lbound is
  21. // zero!
  22. //=--------------------------------------------------------------------------=
  23. //
  24. class CStringCollection {
  25. public:
  26. // a couple of methods that are common
  27. //
  28. STDMETHOD(get_Count)(THIS_ long FAR* pcStrings);
  29. STDMETHOD(get_Item)(THIS_ long lIndex, BSTR FAR* pbstrItem);
  30. STDMETHOD(get__NewEnum)(THIS_ IUnknown * FAR* ppUnkNewEnum);
  31. CStringCollection(SAFEARRAY *);
  32. virtual ~CStringCollection();
  33. protected:
  34. // what the collection will work with.
  35. //
  36. SAFEARRAY *m_psa;
  37. };
  38. class CStringDynaCollection : public CStringCollection {
  39. public:
  40. // in addition to the CStringCollection methods, we'll have
  41. //
  42. STDMETHOD(put_Item)(THIS_ long lIndex, BSTR bstrItem);
  43. STDMETHOD(Add)(THIS_ BSTR bstrNew);
  44. STDMETHOD(Remove)(THIS_ long lIndex);
  45. CStringDynaCollection(SAFEARRAY *);
  46. virtual ~CStringDynaCollection();
  47. };
  48. #define _STRCOLL_H_
  49. #endif // _STRCOLL_H_