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.

47 lines
2.6 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (C) Microsoft Corporation, 1995 - 1999 All Rights Reserved.
  4. //
  5. // File: CatHelp.h
  6. //
  7. //=======================================================================
  8. /////////////////////////////////////////////////////////////////////////////
  9. //
  10. // contains the prototypes for the component category helper functions
  11. //
  12. #include "comcat.h"
  13. #include "cathelp.h"
  14. EXTERN_C const CATID CATID_SafeForScripting;
  15. EXTERN_C const CATID CATID_SafeForInitializing;
  16. #define REGISTER_SERVER_AND_CATID(clsid) \
  17. { \
  18. HRESULT hr; \
  19. \
  20. /* registers object, typelib and all interfaces in typelib */ \
  21. if ( SUCCEEDED(hr =_Module.RegisterServer(TRUE)) && \
  22. SUCCEEDED(hr = CreateComponentCategory(CATID_SafeForScripting, \
  23. L"Controls that are safely scriptable")) && \
  24. SUCCEEDED(hr = CreateComponentCategory(CATID_SafeForInitializing, \
  25. L"Controls safely initializable from persistent data")) && \
  26. SUCCEEDED(hr = RegisterCLSIDInCategory(clsid, \
  27. CATID_SafeForScripting)) ) \
  28. { \
  29. hr = RegisterCLSIDInCategory(clsid, CATID_SafeForInitializing); \
  30. } \
  31. return hr; \
  32. }
  33. #define UNREGISTER_SERVER_AND_CATID(clsid) \
  34. { \
  35. _Module.UnregisterServer(); \
  36. \
  37. /* Remove CATID information. */ \
  38. UnRegisterCLSIDInCategory(clsid, CATID_SafeForScripting); \
  39. UnRegisterCLSIDInCategory(clsid, CATID_SafeForInitializing); \
  40. \
  41. return S_OK; \
  42. }