home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / controls / smiley / smilectl / smileppg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  3.4 KB  |  114 lines

  1. // SmilePpg.cpp : Implementation of the CSmilePropPage property page class.
  2.  
  3. #include "stdafx.h"
  4. #include "Smile.h"
  5. #include "SmilePpg.h"
  6.  
  7. #ifndef _RUNTIME
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15.  
  16. IMPLEMENT_DYNCREATE(CSmilePropPage, COlePropertyPage)
  17.  
  18. #ifdef _USRDLL
  19. IMPLEMENT_DYNCREATE(CSmileColorPropPage, CColorPropPage)
  20. IMPLEMENT_DYNCREATE(CSmileFontPropPage, CFontPropPage)
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // Message map
  25.  
  26. BEGIN_MESSAGE_MAP(CSmilePropPage, COlePropertyPage)
  27.     //{{AFX_MSG_MAP(CSmilePropPage)
  28.     // NOTE - ClassWizard will add and remove message map entries
  29.     //    DO NOT EDIT what you see in these blocks of generated code !
  30.     //}}AFX_MSG_MAP
  31. END_MESSAGE_MAP()
  32.  
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // Initialize class factory and guid
  36.  
  37. IMPLEMENT_OLECREATE_EX(CSmilePropPage, "SMILE.SmilePropPage.1",
  38.     0x175cb004, 0xbeed, 0x11ce, 0x96, 0x11, 0, 0xaa, 0, 0x4a, 0x75, 0xcf);
  39.  
  40. #ifdef _USRDLL
  41. // {C7AB95CC-A54E-11d0-A2A3-00C04FD91807}
  42. IMPLEMENT_OLECREATE_EX(CSmileColorPropPage, "SMILE.SmileColorPropPage.1",
  43.     0xc7ab95cc, 0xa54e, 0x11d0, 0xa2, 0xa3, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x7);
  44. // {C7AB95CD-A54E-11d0-A2A3-00C04FD91807}
  45. IMPLEMENT_OLECREATE_EX(CSmileFontPropPage, "SMILE.SmileFontPropPage.1",
  46.     0xc7ab95cd, 0xa54e, 0x11d0, 0xa2, 0xa3, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x7);
  47. #endif
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CSmilePropPage::CSmilePropPageFactory::UpdateRegistry -
  51. // Adds or removes system registry entries for CSmilePropPage
  52.  
  53. BOOL CSmilePropPage::CSmilePropPageFactory::UpdateRegistry(BOOL bRegister)
  54. {
  55.     if (bRegister)
  56.         return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
  57.             m_clsid, IDS_Smile_PPG);
  58.     else
  59.         return AfxOleUnregisterClass(m_clsid, NULL);
  60. }
  61.  
  62. #ifdef _USRDLL
  63. BOOL CSmileColorPropPage::CSmileColorPropPageFactory::UpdateRegistry(BOOL bRegister)
  64. {
  65.     if (bRegister)
  66.         return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
  67.             m_clsid, IDS_SmileFont_PPG);
  68.     else
  69.         return AfxOleUnregisterClass(m_clsid, NULL);
  70. }
  71.  
  72. BOOL CSmileFontPropPage::CSmileFontPropPageFactory::UpdateRegistry(BOOL bRegister)
  73. {
  74.     if (bRegister)
  75.         return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
  76.             m_clsid, IDS_SmileFont_PPG);
  77.     else
  78.         return AfxOleUnregisterClass(m_clsid, NULL);
  79. }
  80. #endif
  81.  
  82. /////////////////////////////////////////////////////////////////////////////
  83. // CSmilePropPage::CSmilePropPage - Constructor
  84.  
  85. CSmilePropPage::CSmilePropPage() :
  86.     COlePropertyPage(IDD, IDS_Smile_PPG_CAPTION)
  87. {
  88.     //{{AFX_DATA_INIT(CSmilePropPage)
  89.     m_strCaption = _T("");
  90.     m_bSad = FALSE;
  91.     //}}AFX_DATA_INIT
  92. }
  93.  
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CSmilePropPage::DoDataExchange - Moves data between page and properties
  97.  
  98. void CSmilePropPage::DoDataExchange(CDataExchange* pDX)
  99. {
  100.     //{{AFX_DATA_MAP(CSmilePropPage)
  101.     DDP_Text(pDX, IDC_EDIT1, m_strCaption, _T("Caption") );
  102.     DDX_Text(pDX, IDC_EDIT1, m_strCaption);
  103.     DDP_Check(pDX, IDC_CHECK1, m_bSad, _T("Sad") );
  104.     DDX_Check(pDX, IDC_CHECK1, m_bSad);
  105.     //}}AFX_DATA_MAP
  106.     DDP_PostProcessing(pDX);
  107. }
  108.  
  109.  
  110. /////////////////////////////////////////////////////////////////////////////
  111. // CSmilePropPage message handlers
  112.  
  113. #endif // !_RUNTIME
  114.