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.

89 lines
2.3 KiB

  1. #include <stdafx.h>
  2. #include "langchange.h"
  3. #include <initguid.h>
  4. //
  5. // Standard IUnknown implementation
  6. //
  7. ULONG CLangChange::AddRef()
  8. {
  9. return InterlockedIncrement(&m_lRef);
  10. }
  11. //
  12. // Standard IUnknown implementation
  13. //
  14. ULONG CLangChange::Release()
  15. {
  16. if (InterlockedDecrement(&m_lRef) == 0)
  17. {
  18. delete this;
  19. return 0;
  20. }
  21. return m_lRef;
  22. }
  23. //
  24. // Standard IUnknown implementation
  25. //
  26. STDMETHODIMP CLangChange::QueryInterface(REFIID riid, LPVOID *ppv)
  27. {
  28. *ppv = NULL;
  29. SATraceFunction("CLangChange::QueryInterface");
  30. if (IID_IUnknown==riid)
  31. {
  32. *ppv = (void *)(IUnknown *) this;
  33. AddRef();
  34. return S_OK;
  35. }
  36. else
  37. {
  38. if (IID_ISALangChange==riid)
  39. {
  40. *ppv = (void *)(ISALangChange *) this;
  41. AddRef();
  42. return S_OK;
  43. }
  44. }
  45. return E_NOINTERFACE;
  46. }
  47. //++----------------------------------------------------------------------------
  48. //
  49. // Function: InformChange
  50. //
  51. // Synopsis: This is the method called by Loc Mgr when the language
  52. // on the SA changes. This method informs the worker
  53. // thread of the adapter to refresh its strings.
  54. //
  55. // Arguments: bstrLangDisplayName - language display name (Eg.- English)
  56. // bstrLangISOName - Language ISO name (Eg. - en)
  57. // ulLangID - Language ID (Eg.- US English is 0409)
  58. //
  59. // Returns: HRESULT - success/failure
  60. //
  61. // History: BalajiB Created 05/24/2000
  62. //
  63. // Called By; Localization Manager
  64. //
  65. //------------------------------------------------------------------------------
  66. STDMETHODIMP CLangChange::InformChange(
  67. /*[in]*/ BSTR bstrLangDisplayName,
  68. /*[in]*/ BSTR bstrLangISOName,
  69. /*[in]*/ unsigned long ulLangID
  70. )
  71. {
  72. BOOL fStat = FALSE;
  73. SATracePrintf("LangName(%ws), ISOName(%ws), ID(%ld)",
  74. bstrLangDisplayName,
  75. bstrLangISOName,
  76. ulLangID);
  77. if (m_hWnd)
  78. {
  79. PostMessage(m_hWnd,wm_SaLocMessage,(WPARAM)0,(LPARAM)0);
  80. }
  81. return S_OK;
  82. }