home *** CD-ROM | disk | FTP | other *** search
/ Building OCXs / Building_OCXs_Que_1995.iso / code / ch09 / commppg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-14  |  2.0 KB  |  75 lines

  1. // commppg.cpp : Implementation of the CCommPropPage property page class.
  2.  
  3. #include "stdafx.h"
  4. #include "comm.h"
  5. #include "commppg.h"
  6.  
  7. #ifdef _DEBUG
  8. #undef THIS_FILE
  9. static char BASED_CODE THIS_FILE[] = __FILE__;
  10. #endif
  11.  
  12.  
  13. IMPLEMENT_DYNCREATE(CCommPropPage, COlePropertyPage)
  14.  
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // Message map
  18.  
  19. BEGIN_MESSAGE_MAP(CCommPropPage, COlePropertyPage)
  20.     //{{AFX_MSG_MAP(CCommPropPage)
  21.     //}}AFX_MSG_MAP
  22. END_MESSAGE_MAP()
  23.  
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // Initialize class factory and guid
  27.  
  28. IMPLEMENT_OLECREATE_EX(CCommPropPage, "COMM.CommPropPage.1",
  29.     0x5b83b084, 0x14f0, 0x11ce, 0x96, 0xf, 0x52, 0x41, 0x53, 0x48, 0x0, 0x5)
  30.  
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CCommPropPage::CCommPropPageFactory::UpdateRegistry -
  34. // Adds or removes system registry entries for CCommPropPage
  35.  
  36. BOOL CCommPropPage::CCommPropPageFactory::UpdateRegistry(BOOL bRegister)
  37. {
  38.     if (bRegister)
  39.         return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
  40.             m_clsid, IDS_COMM_PPG);
  41.     else
  42.         return AfxOleUnregisterClass(m_clsid, NULL);
  43. }
  44.  
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CCommPropPage::CCommPropPage - Constructor
  48.  
  49. CCommPropPage::CCommPropPage() :
  50.     COlePropertyPage(IDD, IDS_COMM_PPG_CAPTION)
  51. {
  52.     //{{AFX_DATA_INIT(CCommPropPage)
  53.     m_phoneNumber = _T("");
  54.     //}}AFX_DATA_INIT
  55. }
  56.  
  57.  
  58. /////////////////////////////////////////////////////////////////////////////
  59. // CCommPropPage::DoDataExchange - Moves data between page and properties
  60.  
  61. void CCommPropPage::DoDataExchange(CDataExchange* pDX)
  62. {
  63.     //{{AFX_DATA_MAP(CCommPropPage)
  64.     DDP_Text(pDX, IDC_PHONE1, m_phoneNumber, _T("PhoneNumber") );
  65.     DDX_Text(pDX, IDC_PHONE1, m_phoneNumber);
  66.     DDV_MaxChars(pDX, m_phoneNumber, 14);
  67.     //}}AFX_DATA_MAP
  68.     DDP_PostProcessing(pDX);
  69. }
  70.  
  71.  
  72. /////////////////////////////////////////////////////////////////////////////
  73. // CCommPropPage message handlers
  74.  
  75.