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.

69 lines
2.5 KiB

  1. //---------------------------------------------------------------------------
  2. // The CMSIControl class is used to encapsulate a control which can be used
  3. // by MSInfo to show information. This class was originally generated from
  4. // an actual control (inserted using the component gallery). It was then
  5. // modified to create controls with an arbitrary CLSID.
  6. //
  7. // Further modifications were necessary to make MSInfo truly support OLE
  8. // controls for information categories. Specifically, we need to get the
  9. // DISPIDs for methods and properties at runtime, rather than when the
  10. // component was added.
  11. //---------------------------------------------------------------------------
  12. #ifndef __MSICTRL_H__
  13. #define __MSICTRL_H__
  14. // class CCtrlRefresh;
  15. class CMSIControl : public CWnd
  16. {
  17. protected:
  18. DECLARE_DYNCREATE(CMSIControl)
  19. private:
  20. CLSID m_clsidCtrl;
  21. BOOL m_fInRefresh;
  22. // CCtrlRefresh * m_pRefresh;
  23. public:
  24. BOOL m_fLoadFailed;
  25. // The control can be constructed with or without a CLSID. If none
  26. // is supplied to the constructor, SetCLSID must be called before
  27. // the control is created.
  28. CMSIControl() { /*m_pRefresh = NULL;*/ m_fInRefresh = m_fLoadFailed = FALSE; };
  29. CMSIControl(CLSID clsid) { /*m_pRefresh = NULL;*/ m_fInRefresh = m_fLoadFailed = FALSE; m_clsidCtrl = clsid; };
  30. ~CMSIControl();
  31. void SetCLSID(CLSID clsid) { m_clsidCtrl = clsid; };
  32. // Two Create functions are supplied (in the orginal generated class).
  33. virtual BOOL Create(LPCTSTR /* lpszClassName */, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* /* pContext */ = NULL)
  34. { return CreateControl(m_clsidCtrl, lpszWindowName, dwStyle, rect, pParentWnd, nID); };
  35. BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE, BSTR bstrLicKey = NULL)
  36. { return CreateControl(m_clsidCtrl, lpszWindowName, dwStyle, rect, pParentWnd, nID, pPersist, bStorage, bstrLicKey); };
  37. // Attributes
  38. public:
  39. long GetMSInfoView();
  40. void SetMSInfoView(long);
  41. // Operations
  42. public:
  43. void Refresh();
  44. void MSInfoRefresh();
  45. void MSInfoSelectAll();
  46. void MSInfoCopy();
  47. BOOL MSInfoLoadFile(LPCTSTR strFileName);
  48. void MSInfoUpdateView();
  49. long MSInfoGetData(long dwMSInfoView, long* pBuffer, long dwLength);
  50. void AboutBox();
  51. void CancelMSInfoRefresh();
  52. BOOL InRefresh();
  53. // Methods (which don't correspond to OLE control methods)
  54. BOOL GetDISPID(char *szName, DISPID *pID);
  55. BOOL SaveToStream(IStream *pStream);
  56. };
  57. #endif