PageRenderTime 37ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/Visual Studio 2008/CppExeCOMServer/Reg.h

#
C Header | 134 lines | 14 code | 10 blank | 110 comment | 0 complexity | 8918cdffb563bdd7d5d022c1b2d3be7c MD5 | raw file
  1. /****************************** Module Header ******************************\
  2. Module Name: Reg.h
  3. Project: CppExeCOMServer
  4. Copyright (c) Microsoft Corporation.
  5. This source is subject to the Microsoft Public License.
  6. See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
  7. All other rights reserved.
  8. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
  9. EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  10. WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
  11. \***************************************************************************/
  12. #pragma once
  13. #include <windows.h>
  14. //
  15. // FUNCTION: RegisterLocalServer
  16. //
  17. // PURPOSE: This helper function registers the out-of-process component in
  18. // the registry.
  19. //
  20. // PARAMETERS:
  21. // * pszModule - Path of the module that contains the component
  22. // * clsid - Class ID of the component
  23. // * pszFriendlyName - Friendly name
  24. // * pszThreadModel - Threading model
  25. // * libid - Type library ID
  26. // * pszProgID - ProgID of the component
  27. // * pszVerIndProgID - Version independent ProgID
  28. //
  29. // NOTE: The function creates the HKCR\CLSID\{<CLSID>} key and the
  30. // HKCR\<ProgID> key in the registry.
  31. //
  32. // HKCR
  33. // {
  34. // <ProgID> = s '<Friendly Name>'
  35. // {
  36. // CLSID = s '{<CLSID>}'
  37. // }
  38. // <VersionIndependentProgID> = s '<Friendly Name>'
  39. // {
  40. // CLSID = s '{<CLSID>}'
  41. // CurVer = s '<ProgID>'
  42. // }
  43. // NoRemove CLSID
  44. // {
  45. // ForceRemove {<CLSID>} = s '<Friendly Name>'
  46. // {
  47. // ProgID = s '<ProgID>'
  48. // VersionIndependentProgID = s '<VersionIndependentProgID>'
  49. // LocalServer32 = s '%MODULE%'
  50. // TypeLib = s '{<LIBID>}'
  51. // }
  52. // }
  53. // }
  54. //
  55. HRESULT RegisterLocalServer(PCWSTR pszModule,
  56. const CLSID& clsid,
  57. PCWSTR pszFriendlyName,
  58. const IID& libid,
  59. PCWSTR pszProgID,
  60. PCWSTR pszVerIndProgID);
  61. //
  62. // FUNCTION: UnregisterLocalServer(void)
  63. //
  64. // PURPOSE: Unegister the out-of-process component in the registry.
  65. //
  66. // PARAMETERS:
  67. // * clsid - Class ID of the component
  68. // * pszProgID - ProgID of the component
  69. // * pszVerIndProgID - Version independent ProgID
  70. //
  71. // NOTE: The function deletes the HKCR\CLSID\{<CLSID>} key and the
  72. // HKCR\<ProgID> key in the registry.
  73. //
  74. HRESULT UnregisterLocalServer(const CLSID& clsid,
  75. PCWSTR pszProgID,
  76. PCWSTR pszVerIndProgID);
  77. //
  78. // FUNCTION: RegisterTypeLib
  79. //
  80. // PURPOSE: This helper function registers the type library.
  81. //
  82. // PARAMETERS:
  83. // * pszTypeLib - The type library file.
  84. //
  85. // NOTE: The function creates the HKCR\TypeLib\{<LIBID>} key and the
  86. // HKCR\Interface\{<IID>} key in the registry.
  87. //
  88. // HKCR
  89. // {
  90. // NoRemove TypeLib
  91. // {
  92. ...
  93. // }
  94. // NoRemove Interface
  95. // {
  96. // ForceRemove {<IID>} = s '<Interface Name>'
  97. // {
  98. // ProxyStubClsid = s '<ProgID>'
  99. // ProxyStubClsid32 = s '<VersionIndependentProgID>'
  100. // TypeLib = s '{<LIBID>}'
  101. // {
  102. // val Version = s '<TypeLib Version>'
  103. // }
  104. // }
  105. // }
  106. // }
  107. //
  108. HRESULT RegisterTypeLib(PCWSTR pszTypeLib);
  109. //
  110. // FUNCTION: UnregisterTypeLib
  111. //
  112. // PURPOSE: This helper function unregisters the type library.
  113. //
  114. // PARAMETERS:
  115. // * pszTypeLib - The type library file.
  116. //
  117. // NOTE: The function deletes the HKCR\TypeLib\{<LIBID>} key and the
  118. // HKCR\Interface\{<IID>} key in the registry.
  119. //
  120. HRESULT UnregisterTypeLib(PCWSTR pszTypeLib);