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.5 KiB

  1. /*
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. */
  4. // propbag.h : Declaration of the CMyPropertyBag
  5. #ifndef __CMyPropertyBag_H_
  6. #define __CMyPropertyBag_H_
  7. //
  8. // CMyPropertyBag
  9. class ATL_NO_VTABLE CMyPropertyBag :
  10. public CComObjectRootEx<CComMultiThreadModel>,
  11. public IPropertyBag
  12. {
  13. private:
  14. DWORD m_dwDeviceInID;
  15. DWORD m_dwDeviceOutID;
  16. public:
  17. BEGIN_COM_MAP(CMyPropertyBag)
  18. COM_INTERFACE_ENTRY(IPropertyBag)
  19. END_COM_MAP()
  20. HRESULT
  21. STDMETHODCALLTYPE
  22. Read(
  23. LPCOLESTR pszPropName,
  24. VARIANT *pVar,
  25. IErrorLog *pErrorLog
  26. )
  27. {
  28. if (lstrcmpiW( pszPropName, L"WaveInId" ) == 0)
  29. {
  30. pVar->vt = VT_I4;
  31. pVar->lVal = m_dwDeviceInID;
  32. return S_OK;
  33. }
  34. if (lstrcmpiW( pszPropName, L"WaveOutId" ) == 0)
  35. {
  36. pVar->vt = VT_I4;
  37. pVar->lVal = m_dwDeviceOutID;
  38. return S_OK;
  39. }
  40. return S_FALSE;
  41. }
  42. HRESULT
  43. STDMETHODCALLTYPE
  44. Write(
  45. LPCOLESTR pszPropName,
  46. VARIANT *pVar
  47. )
  48. {
  49. if (lstrcmpiW( pszPropName, L"WaveInId" ) == 0)
  50. {
  51. m_dwDeviceInID = pVar->lVal;
  52. return S_OK;
  53. }
  54. if (lstrcmpiW( pszPropName, L"WaveOutId" ) == 0)
  55. {
  56. m_dwDeviceOutID = pVar->lVal;
  57. return S_OK;
  58. }
  59. return S_FALSE;
  60. };
  61. };
  62. #endif