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.

83 lines
2.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: doccnfg.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // DocCnfg.h: Definition of the CMMCDocConfig class
  11. //
  12. //////////////////////////////////////////////////////////////////////
  13. #ifndef _DOCCNFG_H_
  14. #define _DOCCNFG_H_
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CMMCDocConfig
  17. class CMMCDocConfig :
  18. public CComDualImpl<IDocConfig, &IID_IDocConfig, &LIBID_NODEMGRLib>,
  19. //public ISupportErrorInfo,
  20. public CComObjectRoot,
  21. public IDumpSnapins,
  22. public CComCoClass<CMMCDocConfig, &CLSID_MMCDocConfig>,
  23. public CConsoleFilePersistor
  24. {
  25. private:
  26. IStoragePtr m_spStorage;
  27. tstring m_strFilePath;
  28. CAutoPtr<CSnapInsCache> m_spCache;
  29. CXMLDocument m_XMLDocument;
  30. CXMLElement m_XMLElemConsole;
  31. CXMLElement m_XMLElemTree;
  32. public:
  33. ~CMMCDocConfig();
  34. BEGIN_COM_MAP(CMMCDocConfig)
  35. COM_INTERFACE_ENTRY(IDispatch)
  36. COM_INTERFACE_ENTRY(IDocConfig)
  37. COM_INTERFACE_ENTRY(IDumpSnapins)
  38. //COM_INTERFACE_ENTRY(ISupportErrorInfo)
  39. END_COM_MAP()
  40. DECLARE_AGGREGATABLE(CMMCDocConfig)
  41. DECLARE_MMC_OBJECT_REGISTRATION (
  42. g_szMmcndmgrDll, // implementing DLL
  43. CLSID_MMCDocConfig, // CLSID
  44. _T("DocConfig 1.0 Object"), // class name
  45. _T("NODEMGR.MMCDocConfig.1"), // ProgID
  46. _T("NODEMGR.MMCDocConfig")) // version-independent ProgID
  47. // ISupportsErrorInfo
  48. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  49. // IDocConfig
  50. public:
  51. STDMETHOD(OpenFile)(BSTR bstrFilePath);
  52. STDMETHOD(SaveFile)(BSTR bstrFilePath);
  53. STDMETHOD(CloseFile)();
  54. STDMETHOD(EnableSnapInExtension)(BSTR bstrSnapInCLSID, BSTR bstrExtCLSID, VARIANT_BOOL bEnable);
  55. // IDumpSnapins
  56. STDMETHOD(Dump)(LPCTSTR pszDumpFilePath);
  57. STDMETHOD(CheckSnapinAvailability)(CAvailableSnapinInfo& asi);
  58. private:
  59. BOOL IsFileOpen() { return !m_strFilePath.empty(); }
  60. SC ScOpenFile(BSTR bstrFilePath);
  61. SC ScCloseFile();
  62. SC ScSaveFile(BSTR bstrFilePath);
  63. SC ScEnableSnapInExtension(BSTR bstrSnapInCLSID, BSTR bstrExtCLSID, VARIANT_BOOL bEnable);
  64. SC ScDump (LPCTSTR pszDumpFilePath);
  65. SC ScCheckSnapinAvailability (CAvailableSnapinInfo& asi);
  66. };
  67. #endif // _DOCCNFG_H_