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.

78 lines
1.5 KiB

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