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.

108 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. FaxRecipients.h
  5. Abstract:
  6. Declaration of the CFaxRecipients class.
  7. Author:
  8. Iv Garber (IvG) Jul, 2000
  9. Revision History:
  10. --*/
  11. #ifndef __FAXRECIPIENTS_H_
  12. #define __FAXRECIPIENTS_H_
  13. #include "resource.h" // main symbols
  14. #include <deque>
  15. #include "VCUE_Copy.h"
  16. #include "FaxRecipient.h"
  17. namespace Recipients
  18. {
  19. // Store the Recipients in the Deque
  20. typedef std::deque<IFaxRecipient*> ContainerType;
  21. // Expose the Recipients
  22. typedef IFaxRecipient* CollectionExposedType;
  23. typedef IFaxRecipients CollectionIfc;
  24. // Use IEnumVARIANT as the enumerator for VB compatibility
  25. typedef VARIANT EnumExposedType;
  26. typedef IEnumVARIANT EnumIfc;
  27. // Typedef the copy classes using existing typedefs
  28. typedef VCUE::CopyIfc2Variant<ContainerType::value_type> EnumCopyType;
  29. typedef VCUE::CopyIfc<CollectionExposedType> CollectionCopyType;
  30. typedef CComEnumOnSTL< EnumIfc, &__uuidof(EnumIfc),
  31. EnumExposedType, EnumCopyType, ContainerType > EnumType;
  32. typedef ICollectionOnSTLImpl< CollectionIfc, ContainerType,
  33. CollectionExposedType, CollectionCopyType, EnumType > CollectionType;
  34. };
  35. using namespace Recipients;
  36. //
  37. //=============================== FAX RECIPIENTS =====================================
  38. //
  39. class ATL_NO_VTABLE CFaxRecipients :
  40. public CComObjectRootEx<CComSingleThreadModel>,
  41. public ISupportErrorInfo,
  42. public IDispatchImpl<Recipients::CollectionType, &IID_IFaxRecipients, &LIBID_FAXCOMEXLib>
  43. {
  44. public:
  45. CFaxRecipients()
  46. {
  47. DBG_ENTER(_T("FAX RECIPIENTS -- CREATE"));
  48. }
  49. ~CFaxRecipients()
  50. {
  51. DBG_ENTER(_T("FAX RECIPIENTS -- DESTROY"));
  52. //
  53. // Free the Collection
  54. //
  55. HRESULT hr = S_OK;
  56. long size = m_coll.size();
  57. for ( long i = 1 ; i <= size ; i++ )
  58. {
  59. hr = Remove(1);
  60. if (FAILED(hr))
  61. {
  62. CALL_FAIL(GENERAL_ERR, _T("Remove(1)"), hr);
  63. }
  64. }
  65. }
  66. DECLARE_REGISTRY_RESOURCEID(IDR_FAXRECIPIENTS)
  67. DECLARE_NOT_AGGREGATABLE(CFaxRecipients)
  68. DECLARE_PROTECT_FINAL_CONSTRUCT()
  69. BEGIN_COM_MAP(CFaxRecipients)
  70. COM_INTERFACE_ENTRY(IFaxRecipients)
  71. COM_INTERFACE_ENTRY(IDispatch)
  72. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  73. END_COM_MAP()
  74. // Interfaces
  75. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  76. STDMETHOD(Add)(/*[in]*/ BSTR bstrFaxNumber, /*[in, defaultvalue("")]*/ BSTR bstrName, IFaxRecipient **ppRecipient);
  77. STDMETHOD(Remove)(/*[in]*/ long lIndex);
  78. // Internal Use
  79. static HRESULT Create(IFaxRecipients **ppFaxRecipients);
  80. };
  81. #endif //__FAXRECIPIENTS_H_