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.

84 lines
1.8 KiB

  1. /*
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. */
  4. #ifndef __SDP_ADDRESS_TEXT_SAFEARRAY__
  5. #define __SDP_ADDRESS_TEXT_SAFEARRAY__
  6. #include "sdpcommo.h"
  7. #include "sdpsarr.h"
  8. class _DllDecl SDP_ADDRESS_TEXT_SAFEARRAY :
  9. protected SDP_SAFEARRAY_WRAP_EX<SDP_ADDRESS_TEXT, SDP_ADDRESS_TEXT_LIST>
  10. {
  11. public:
  12. inline SDP_ADDRESS_TEXT_SAFEARRAY(
  13. IN SDP_ADDRESS_TEXT_LIST &SdpAddressTextList
  14. );
  15. HRESULT GetSafeArray(
  16. OUT VARIANT *AddressVariant,
  17. OUT VARIANT *TextVariant
  18. );
  19. inline HRESULT SetSafeArray(
  20. IN VARIANT &AddressVariant,
  21. IN VARIANT &TextVariant
  22. );
  23. protected:
  24. VARTYPE m_VarType[2];
  25. virtual BOOL Get(
  26. IN SDP_ADDRESS_TEXT &ListMember,
  27. IN ULONG NumEntries,
  28. IN void **Element,
  29. OUT HRESULT &HResult
  30. );
  31. virtual BOOL Set(
  32. IN SDP_ADDRESS_TEXT &ListMember,
  33. IN ULONG NumEntries,
  34. IN void ***Element,
  35. OUT HRESULT &HResult
  36. );
  37. };
  38. inline
  39. SDP_ADDRESS_TEXT_SAFEARRAY::SDP_ADDRESS_TEXT_SAFEARRAY(
  40. IN SDP_ADDRESS_TEXT_LIST &SdpAddressTextList
  41. )
  42. : SDP_SAFEARRAY_WRAP_EX<SDP_ADDRESS_TEXT, SDP_ADDRESS_TEXT_LIST>(SdpAddressTextList)
  43. {
  44. m_VarType[0] = VT_BSTR;
  45. m_VarType[1] = VT_BSTR;
  46. }
  47. inline HRESULT
  48. SDP_ADDRESS_TEXT_SAFEARRAY::SetSafeArray(
  49. IN VARIANT &AddressVariant,
  50. IN VARIANT &TextVariant
  51. )
  52. {
  53. VARIANT *VariantArray[] = {&AddressVariant, &TextVariant};
  54. return SetSafeArrays(
  55. sizeof(VariantArray)/sizeof(VARIANT *),
  56. m_VarType,
  57. VariantArray
  58. );
  59. }
  60. #endif // __SDP_ADDRESS_TEXT_SAFEARRAY__