home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / controls / time / timeppg.cpp < prev    next >
C/C++ Source or Header  |  1998-03-26  |  3KB  |  88 lines

  1. // timeppg.cpp : Implementation of the CTimePropPage property page class.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13.  
  14. #include "stdafx.h"
  15. #include "time.h"
  16. #include "timeppg.h"
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char BASED_CODE THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23.  
  24. IMPLEMENT_DYNCREATE(CTimePropPage, COlePropertyPage)
  25.  
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // Message map
  29.  
  30. BEGIN_MESSAGE_MAP(CTimePropPage, COlePropertyPage)
  31.     //{{AFX_MSG_MAP(CTimePropPage)
  32.     //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34.  
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // Initialize class factory and guid
  38.  
  39. IMPLEMENT_OLECREATE_EX(CTimePropPage, "TIME.TimePropPage.1",
  40.     0x37446b93, 0x5870, 0x101b, 0xb5, 0x7b, 0x0, 0x60, 0x8c, 0xc9, 0x6a, 0xfa)
  41.  
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CTimePropPage::CTimePropPageFactory::UpdateRegistry -
  45. // Adds or removes system registry entries for CTimePropPage
  46.  
  47. BOOL CTimePropPage::CTimePropPageFactory::UpdateRegistry(BOOL bRegister)
  48. {
  49.     if (bRegister)
  50.         return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
  51.             m_clsid, IDS_TIME_PPG);
  52.     else
  53.         return AfxOleUnregisterClass(m_clsid, NULL);
  54. }
  55.  
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58. // CTimePropPage::CTimePropPage - Constructor
  59.  
  60. CTimePropPage::CTimePropPage() :
  61.     COlePropertyPage(IDD, IDS_TIME_PPG_CAPTION)
  62. {
  63.     //{{AFX_DATA_INIT(CTimePropPage)
  64.     m_Enabled = FALSE;
  65.     m_Interval = 0;
  66.     //}}AFX_DATA_INIT
  67. }
  68.  
  69.  
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CTimePropPage::DoDataExchange - Moves data between page and properties
  72.  
  73. void CTimePropPage::DoDataExchange(CDataExchange* pDX)
  74. {
  75.     //{{AFX_DATA_MAP(CTimePropPage)
  76.     DDP_Check(pDX, IDC_ENABLEDCHECK, m_Enabled, _T("Enabled"));
  77.     DDX_Check(pDX, IDC_ENABLEDCHECK, m_Enabled);
  78.     DDP_Text(pDX, IDC_INTERVALEDIT, m_Interval, _T("Interval"));
  79.     DDX_Text(pDX, IDC_INTERVALEDIT, m_Interval);
  80.     DDV_MinMaxInt(pDX, m_Interval, 1, 32767);
  81.     //}}AFX_DATA_MAP
  82.     DDP_PostProcessing(pDX);
  83. }
  84.  
  85.  
  86. /////////////////////////////////////////////////////////////////////////////
  87. // CTimePropPage message handlers
  88.