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.

83 lines
1.7 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 2001 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: customlbacc.h
  6. //
  7. // Creator: weiw
  8. //
  9. // Purpose: custom list box accessibility header file
  10. //
  11. //=======================================================================
  12. #pragma once
  13. #include <pch.h>
  14. class MYLBAccPropServer : public IAccPropServer {
  15. LONG m_Ref;
  16. IAccPropServices * m_pAccPropSvc;
  17. public:
  18. MYLBAccPropServer(IAccPropServices * pAccPropSvc )
  19. : m_Ref( 1 ),
  20. m_pAccPropSvc( pAccPropSvc )
  21. {
  22. m_pAccPropSvc->AddRef();
  23. }
  24. ~MYLBAccPropServer()
  25. {
  26. m_pAccPropSvc->Release();
  27. }
  28. // IUnknown
  29. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject)
  30. {
  31. HRESULT hr = S_OK;
  32. *ppvObject = NULL;
  33. if (__uuidof(IUnknown) == riid ||
  34. __uuidof(IAccPropServer) == riid)
  35. {
  36. *ppvObject = (void *)this;
  37. AddRef();
  38. }
  39. else
  40. {
  41. DEBUGMSG("MYLBAccPropServer QueryInterface(): interface not supported");
  42. hr = E_NOINTERFACE;
  43. }
  44. return hr;
  45. }
  46. STDMETHOD_(ULONG, AddRef)(void)
  47. {
  48. long cRef = InterlockedIncrement(&m_Ref);
  49. //DEBUGMSG("MYLBAccPropServer AddRef = %d", cRef);
  50. return cRef;
  51. }
  52. STDMETHOD_(ULONG, Release)(void)
  53. {
  54. long cRef = InterlockedDecrement(&m_Ref);
  55. //DEBUGMSG("MYLBAccPropServer Release = %d", cRef);
  56. if (0 == cRef)
  57. {
  58. delete this;
  59. }
  60. return cRef;
  61. }
  62. // IAccPropServer
  63. HRESULT STDMETHODCALLTYPE GetPropValue (
  64. const BYTE * pIDString,
  65. DWORD dwIDStringLen,
  66. MSAAPROPID idProp,
  67. VARIANT * pvarValue,
  68. BOOL * pfGotProp );
  69. };