windows-nt/Source/XPSP1/NT/enduser/windows.com/winupd/wupdinfo/cathelpp.h

48 lines
2.6 KiB
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
//=======================================================================
//
// Copyright (C) Microsoft Corporation, 1995 - 1999 All Rights Reserved.
//
// File: CatHelp.h
//
//=======================================================================
/////////////////////////////////////////////////////////////////////////////
//
// contains the prototypes for the component category helper functions
//
#include "comcat.h"
#include "cathelp.h"
EXTERN_C const CATID CATID_SafeForScripting;
EXTERN_C const CATID CATID_SafeForInitializing;
#define REGISTER_SERVER_AND_CATID(clsid) \
{ \
HRESULT hr; \
\
/* registers object, typelib and all interfaces in typelib */ \
if ( SUCCEEDED(hr =_Module.RegisterServer(TRUE)) && \
SUCCEEDED(hr = CreateComponentCategory(CATID_SafeForScripting, \
L"Controls that are safely scriptable")) && \
SUCCEEDED(hr = CreateComponentCategory(CATID_SafeForInitializing, \
L"Controls safely initializable from persistent data")) && \
SUCCEEDED(hr = RegisterCLSIDInCategory(clsid, \
CATID_SafeForScripting)) ) \
{ \
hr = RegisterCLSIDInCategory(clsid, CATID_SafeForInitializing); \
} \
return hr; \
}
#define UNREGISTER_SERVER_AND_CATID(clsid) \
{ \
_Module.UnregisterServer(); \
\
/* Remove CATID information. */ \
UnRegisterCLSIDInCategory(clsid, CATID_SafeForScripting); \
UnRegisterCLSIDInCategory(clsid, CATID_SafeForInitializing); \
\
return S_OK; \
}