home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winbase / cluster / smbsmp / smbsmpex / basepage.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-29  |  4.6 KB  |  162 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. //    Copyright (c) 1997 <company name>
  4. //
  5. //    Module Name:
  6. //        BasePage.h
  7. //
  8. //    Abstract:
  9. //        Definition of the CBasePropertyPage class.  This class provides base
  10. //        functionality for extension DLL property pages.
  11. //
  12. //    Implementation File:
  13. //        BasePage.cpp
  14. //
  15. //    Author:
  16. //        <name> (<e-mail name>) Mmmm DD, 1997
  17. //
  18. //    Revision History:
  19. //
  20. //    Notes:
  21. //
  22. /////////////////////////////////////////////////////////////////////////////
  23.  
  24. #ifndef _BASEPAGE_H_
  25. #define _BASEPAGE_H_
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // Include Files
  29. /////////////////////////////////////////////////////////////////////////////
  30.  
  31. #ifndef _cluadmex_h__
  32. #include <CluAdmEx.h>
  33. #endif
  34.  
  35. #ifndef _EXTOBJ_H_
  36. #include "ExtObj.h"        // for CExtObject
  37. #endif
  38.  
  39. #ifndef _PROPLIST_H_
  40. #include "PropList.h"    // for CClusPropList, CObjectProperty
  41. #endif
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // Forward Class Declarations
  45. /////////////////////////////////////////////////////////////////////////////
  46.  
  47. class CBasePropertyPage;
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // External Class Declarations
  51. /////////////////////////////////////////////////////////////////////////////
  52.  
  53. class CExtObject;
  54. interface IWCWizardCallback;
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CBasePropertyPage dialog
  58. /////////////////////////////////////////////////////////////////////////////
  59.  
  60. class CBasePropertyPage : public CPropertyPage
  61. {
  62.     DECLARE_DYNCREATE(CBasePropertyPage)
  63.  
  64. // Construction
  65. public:
  66.     CBasePropertyPage(void);
  67.     CBasePropertyPage(IN UINT nIDTemplate, IN UINT nIDCaption = 0);
  68.     virtual ~CBasePropertyPage(void) { }
  69.  
  70.     // Second phase construction.
  71.     virtual BOOL            BInit(IN OUT CExtObject * peo);
  72.     BOOL                    BCreateParamsKey(void);
  73.  
  74. protected:
  75.     void                    CommonConstruct(void);
  76.  
  77. // Attributes
  78. protected:
  79.     CExtObject *            m_peo;
  80.     HPROPSHEETPAGE            m_hpage;
  81.  
  82.     IDD                        m_iddPropertyPage;
  83.     IDD                        m_iddWizardPage;
  84.     IDS                        m_idsCaption;
  85.  
  86.     HPROPSHEETPAGE            Hpage(void) const                { return m_hpage; }
  87.  
  88.     IDD                        IddPropertyPage(void) const        { return m_iddPropertyPage; }
  89.     IDD                        IddWizardPage(void) const        { return m_iddWizardPage; }
  90.     IDS                        IdsCaption(void) const            { return m_idsCaption; }
  91.  
  92. public:
  93.     CExtObject *            Peo(void) const                    { return m_peo; }
  94.     void                    SetHpage(IN OUT HPROPSHEETPAGE hpage) { m_hpage = hpage; }
  95.     CLUADMEX_OBJECT_TYPE    Cot(void) const;
  96.  
  97. // Dialog Data
  98.     //{{AFX_DATA(CBasePropertyPage)
  99.     enum { IDD = 0 };
  100.     //}}AFX_DATA
  101.     CStatic    m_staticIcon;
  102.     CStatic    m_staticTitle;
  103.     CString    m_strTitle;
  104.  
  105. // Overrides
  106.     // ClassWizard generate virtual function overrides
  107.     //{{AFX_VIRTUAL(CBasePropertyPage)
  108.     public:
  109.     virtual BOOL OnSetActive();
  110.     virtual BOOL OnApply();
  111.     virtual LRESULT OnWizardBack();
  112.     virtual LRESULT OnWizardNext();
  113.     virtual BOOL OnWizardFinish();
  114.     protected:
  115.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  116.     //}}AFX_VIRTUAL
  117.  
  118.     virtual DWORD            DwParseUnknownProperty(
  119.                                 IN LPCWSTR                            pwszName,
  120.                                 IN const CLUSPROP_BUFFER_HELPER &    rvalue,
  121.                                 IN DWORD                            cbBuf
  122.                                 )        { return ERROR_SUCCESS; }
  123.     virtual BOOL            BApplyChanges(void);
  124.     virtual void            BuildPropList(IN OUT CClusPropList & rcpl);
  125.  
  126.     virtual const CObjectProperty *    Pprops(void) const    { return NULL; }
  127.     virtual DWORD                    Cprops(void) const    { return 0; }
  128.  
  129. // Implementation
  130. protected:
  131.     BOOL                    m_bBackPressed;
  132.  
  133.     BOOL                    BBackPressed(void) const        { return m_bBackPressed; }
  134.     IWCWizardCallback *        PiWizardCallback(void) const;
  135.     BOOL                    BWizard(void) const;
  136.     HCLUSTER                Hcluster(void) const;
  137.     void                    EnableNext(IN BOOL bEnable = TRUE);
  138.  
  139.     DWORD                    DwParseProperties(IN const CClusPropList & rcpl);
  140.     BOOL                    BSetPrivateProps(IN BOOL bValidateOnly = FALSE);
  141.  
  142.     // Generated message map functions
  143.     //{{AFX_MSG(CBasePropertyPage)
  144.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  145.     afx_msg void OnDestroy();
  146.     virtual BOOL OnInitDialog();
  147.     //}}AFX_MSG
  148.     afx_msg void OnChangeCtrl();
  149.     DECLARE_MESSAGE_MAP()
  150.  
  151. };  //*** class CBasePropertyPage
  152.  
  153. /////////////////////////////////////////////////////////////////////////////
  154. // CPageList
  155. /////////////////////////////////////////////////////////////////////////////
  156.  
  157. typedef CList<CBasePropertyPage *, CBasePropertyPage *> CPageList;
  158.  
  159. /////////////////////////////////////////////////////////////////////////////
  160.  
  161. #endif // _BASEPAGE_H_
  162.