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
2.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: hhcwrap.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // hhcwrap.cpp : Implementation of CHHCollectionWrapper
  11. #include "stdafx.h"
  12. #include "shlobj.h"
  13. #include "hhcwrap.h"
  14. #include "hcolwrap_i.c"
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CHHCollectionWrapper
  17. //
  18. // This class is a wrapper class for the HTML Help collection class. MMC uses
  19. // this class so that it doesn't have to statically link to hhsetup.dll, which
  20. // implements the collection class.
  21. //
  22. // The wrapper class methods all return an HRESULT. For collection methods that
  23. // return a DWORD result, the wrapper returns E_FAIL or S_OK. For all other
  24. // collection methods the wrapper returns S_OK.
  25. //
  26. STDMETHODIMP CHHCollectionWrapper::Open(LPCOLESTR FileName)
  27. {
  28. USES_CONVERSION;
  29. DWORD dw = m_collection.Open(W2CT(FileName));
  30. return dw ? E_FAIL : S_OK;
  31. }
  32. STDMETHODIMP CHHCollectionWrapper::Save()
  33. {
  34. DWORD dw = m_collection.Save();
  35. return dw ? E_FAIL : S_OK;
  36. }
  37. STDMETHODIMP CHHCollectionWrapper::Close()
  38. {
  39. DWORD dw = m_collection.Close();
  40. return dw ? E_FAIL : S_OK;
  41. }
  42. STDMETHODIMP CHHCollectionWrapper::RemoveCollection(BOOL bRemoveLocalFiles)
  43. {
  44. m_collection.RemoveCollection(bRemoveLocalFiles);
  45. return S_OK;
  46. }
  47. STDMETHODIMP CHHCollectionWrapper::SetFindMergedCHMS(BOOL bFind)
  48. {
  49. m_collection.SetFindMergedCHMS(bFind);
  50. return S_OK;
  51. }
  52. STDMETHODIMP CHHCollectionWrapper::AddFolder (
  53. LPCOLESTR szName,
  54. DWORD Order,
  55. DWORD *pDWORD,
  56. LANGID LangId )
  57. {
  58. USES_CONVERSION;
  59. m_collection.AddFolder(W2CT(szName), Order, pDWORD, LangId);
  60. return S_OK;
  61. }
  62. STDMETHODIMP CHHCollectionWrapper::AddTitle (
  63. LPCOLESTR Id,
  64. LPCOLESTR FileName,
  65. LPCOLESTR IndexFile,
  66. LPCOLESTR Query,
  67. LPCOLESTR SampleLocation,
  68. LANGID Lang,
  69. UINT uiFlags,
  70. ULONG_PTR pLocation,
  71. DWORD *pDWORD,
  72. BOOL bSupportsMerge,
  73. LPCOLESTR QueryLocation )
  74. {
  75. USES_CONVERSION;
  76. m_collection.AddTitle(W2CT(Id), W2CT(FileName), W2CT(IndexFile), W2CT(Query),
  77. W2CT(SampleLocation), Lang, uiFlags, (CLocation*)pLocation, pDWORD,
  78. bSupportsMerge, W2CT(QueryLocation));
  79. return S_OK;
  80. }