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.

94 lines
1.9 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. wsbushrt.h
  5. Abstract:
  6. This component is an object representations of the USHORT standard type. It
  7. is both a persistable and collectable.
  8. Author:
  9. Chuck Bardeen [cbardeen] 29-Oct-1996
  10. Revision History:
  11. --*/
  12. #include "resource.h"
  13. #include "wsbcltbl.h"
  14. #ifndef _WSBUSHRT_
  15. #define _WSBUSHRT_
  16. /*++
  17. Class Name:
  18. CWsbUshort
  19. Class Description:
  20. An object representations of the USHORT standard type. It
  21. is both persistable and collectable.
  22. --*/
  23. class CWsbUshort :
  24. public CWsbObject,
  25. public IWsbUshort,
  26. public CComCoClass<CWsbUshort,&CLSID_CWsbUshort>
  27. {
  28. public:
  29. CWsbUshort() {}
  30. BEGIN_COM_MAP(CWsbUshort)
  31. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  32. COM_INTERFACE_ENTRY(IPersistStream)
  33. COM_INTERFACE_ENTRY(IWsbUshort)
  34. COM_INTERFACE_ENTRY2(IWsbCollectable, IWsbUshort)
  35. COM_INTERFACE_ENTRY(IWsbPersistStream)
  36. COM_INTERFACE_ENTRY(IWsbTestable)
  37. END_COM_MAP()
  38. DECLARE_REGISTRY_RESOURCEID(IDR_CWsbUshort)
  39. // CComObjectRoot
  40. public:
  41. STDMETHOD(FinalConstruct)(void);
  42. // IPersist
  43. public:
  44. STDMETHOD(GetClassID)(LPCLSID pClsid);
  45. // IPersistStream
  46. public:
  47. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  48. STDMETHOD(Load)(IStream* pStream);
  49. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  50. // IWsbCollectable
  51. public:
  52. STDMETHOD(CompareTo)(IUnknown* pCollectable, SHORT* pResult);
  53. WSB_FROM_CWSBOBJECT;
  54. // IWsbUshort
  55. public:
  56. STDMETHOD(CompareToUshort)(USHORT value, SHORT* pResult);
  57. STDMETHOD(CompareToIUshort)(IWsbUshort* pUshort, SHORT* pResult);
  58. STDMETHOD(GetUshort)(USHORT* pValue);
  59. STDMETHOD(SetUshort)(USHORT value);
  60. // IWsbTestable
  61. public:
  62. STDMETHOD(Test)(USHORT *passed, USHORT *failed);
  63. protected:
  64. USHORT m_value;
  65. };
  66. #endif // _WSBUSHRT_