Leaked source code of windows server 2003
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.

39 lines
621 B

  1. // FilesAndActions.cpp : Implementation of CFilesAndActions
  2. #include "stdafx.h"
  3. #include "FilesAndActions.h"
  4. // CFilesAndActions
  5. STDMETHODIMP CFilesAndActions::Add(VARIANT Item)
  6. {
  7. if (Item.vt == VT_DISPATCH)
  8. {
  9. m_coll.push_back(Item);
  10. return S_OK;
  11. }
  12. else
  13. {
  14. return E_INVALIDARG;
  15. }
  16. }
  17. STDMETHODIMP CFilesAndActions::Remove(long Index)
  18. {
  19. StdVariantList::iterator iList;
  20. // Check bounds
  21. if ((Index <= 0) || (Index > (long)m_coll.size()))
  22. return E_FAIL;
  23. iList = m_coll.begin();
  24. while (Index > 1)
  25. {
  26. iList++;
  27. Index--;
  28. }
  29. m_coll.erase(iList);
  30. return S_OK;
  31. }