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.
|
|
// RegObj.h : Declaration of the CRegObject
/////////////////////////////////////////////////////////////////////////////
// register
class ATL_NO_VTABLE CDLLRegObject : public CRegObject, public CComObjectRoot, public CComCoClass<CDLLRegObject, &CLSID_Registrar> { public: CDLLRegObject() {} ~CDLLRegObject(){CRegObject::ClearReplacements();}
BEGIN_COM_MAP(CDLLRegObject) COM_INTERFACE_ENTRY(IRegistrar) END_COM_MAP()
DECLARE_NOT_AGGREGATABLE(CDLLRegObject) HRESULT FinalConstruct() { return CComObjectRoot::FinalConstruct(); } void FinalRelease() { CComObjectRoot::FinalRelease(); } //we can't use the component because that's what we're registering
//we don't want to do the static registry because we'd have extra code
static HRESULT WINAPI UpdateRegistry(BOOL bRegister) { CComObject<CDLLRegObject>* p; CComObject<CDLLRegObject>::CreateInstance(&p); CComPtr<IRegistrar> pR; p->QueryInterface(IID_IRegistrar, (void**)&pR); return AtlModuleUpdateRegistryFromResourceD(&_Module, (LPCOLESTR)MAKEINTRESOURCE(IDR_Registrar), bRegister, NULL, pR); } };
|