// RegistryOps.h : Declaration of the CRegistryOps #pragma once #include "resource.h" // main symbols #include "windows.h" #include #include #include "Win32RegOps.h" using namespace std ; // CRegistryOps class ATL_NO_VTABLE CRegistryOps : public CComObjectRootEx, public CComCoClass, public IDispatchImpl { public: CRegistryOps() { } DECLARE_REGISTRY_RESOURCEID(IDR_REGISTRYOPS) DECLARE_NOT_AGGREGATABLE(CRegistryOps) BEGIN_COM_MAP(CRegistryOps) COM_INTERFACE_ENTRY(IRegistryOps) COM_INTERFACE_ENTRY(IDispatch) END_COM_MAP() DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } public: STDMETHOD(saveHive)(BSTR fileName, BSTR subKey, BSTR rootKey, BOOL * retCode); STDMETHOD(restoreHive)(BSTR fileName, BSTR subKey, BSTR rootKey, BOOL * retCode); private: HKEY getRootHandle (std::string rootKey) ; }; OBJECT_ENTRY_AUTO(__uuidof(RegistryOps), CRegistryOps)