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.

72 lines
1.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997 - 2000.
  5. //
  6. // File: H N C A T L . H
  7. //
  8. // Contents: Common code for use with ATL.
  9. //
  10. // Notes:
  11. //
  12. // Author: jonburs 23 May 2000 (from shaunco 22 Sep 1997)
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #ifndef _HNCATL_H_
  17. #define _HNCATL_H_
  18. //
  19. // This file should be included *after* your standard ATL include sequence.
  20. //
  21. // #include <atlbase.h>
  22. // extern CComModule _Module;
  23. // #include <atlcom.h>
  24. // #include "hncatl.h" <------
  25. //
  26. // We cannot directly include that sequence here because _Module may be
  27. // derived from CComModule as opposed to an instance of it.
  28. //
  29. //
  30. // We have our own version of AtlModuleRegisterServer coded here
  31. // because the former brings in oleaut32.dll so it can register
  32. // type libraries. We don't care to have a type library registered
  33. // so we can avoid the whole the mess associated with oleaut32.dll.
  34. //
  35. inline
  36. HRESULT
  37. NcAtlModuleRegisterServer(
  38. _ATL_MODULE* pM
  39. )
  40. {
  41. /*AssertH (pM);
  42. AssertH(pM->m_hInst);
  43. AssertH(pM->m_pObjMap);*/
  44. HRESULT hr = S_OK;
  45. for (_ATL_OBJMAP_ENTRY* pEntry = pM->m_pObjMap;
  46. pEntry->pclsid;
  47. pEntry++)
  48. {
  49. if (pEntry->pfnGetObjectDescription() != NULL)
  50. {
  51. continue;
  52. }
  53. hr = pEntry->pfnUpdateRegistry(TRUE);
  54. if (FAILED(hr))
  55. {
  56. break;
  57. }
  58. }
  59. // TraceError ("NcAtlModuleRegisterServer", hr);
  60. return hr;
  61. }
  62. #endif // _HNCATL_H_