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

  1. // AccsPpg.cpp : Implementation of the CAccessPictPropPage 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. #include "stdafx.h"
  14. #include "AccsPict.h"
  15. #include "AccsPpg.h"
  16.  
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23.  
  24. IMPLEMENT_DYNCREATE(CAccessPictPropPage, COlePropertyPage)
  25.  
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // Message map
  29.  
  30. BEGIN_MESSAGE_MAP(CAccessPictPropPage, COlePropertyPage)
  31.     //{{AFX_MSG_MAP(CAccessPictPropPage)
  32.     ON_BN_CLICKED(IDC_STRETCH, OnStretch)
  33.     //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35.  
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // Initialize class factory and guid
  39.  
  40. IMPLEMENT_OLECREATE_EX(CAccessPictPropPage, "ACCESSPICT.AccessPictPropPage.1",
  41.     0x1f4e7c24, 0xc38f, 0x11ce, 0x96, 0x11, 0, 0xaa, 0, 0x4a, 0x75, 0xcf)
  42.  
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CAccessPictPropPage::CAccessPictPropPageFactory::UpdateRegistry -
  46. // Adds or removes system registry entries for CAccessPictPropPage
  47.  
  48. BOOL CAccessPictPropPage::CAccessPictPropPageFactory::UpdateRegistry(BOOL bRegister)
  49. {
  50.     if (bRegister)
  51.         return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
  52.             m_clsid, IDS_ACCESSPICT_PPG);
  53.     else
  54.         return AfxOleUnregisterClass(m_clsid, NULL);
  55. }
  56.  
  57.  
  58. /////////////////////////////////////////////////////////////////////////////
  59. // CAccessPictPropPage::CAccessPictPropPage - Constructor
  60.  
  61. CAccessPictPropPage::CAccessPictPropPage() :
  62.     COlePropertyPage(IDD, IDS_ACCESSPICT_PPG_CAPTION)
  63. {
  64.     //{{AFX_DATA_INIT(CAccessPictPropPage)
  65.     m_bStretch = FALSE;
  66.     m_bPreserve = FALSE;
  67.     m_strCaption = _T("");
  68.     //}}AFX_DATA_INIT
  69. }
  70.  
  71.  
  72. /////////////////////////////////////////////////////////////////////////////
  73. // CAccessPictPropPage::DoDataExchange - Moves data between page and properties
  74.  
  75. void CAccessPictPropPage::DoDataExchange(CDataExchange* pDX)
  76. {
  77.     //{{AFX_DATA_MAP(CAccessPictPropPage)
  78.     DDP_Check(pDX, IDC_STRETCH, m_bStretch, _T("StretchToFit") );
  79.     DDX_Check(pDX, IDC_STRETCH, m_bStretch);
  80.     DDP_Check(pDX, IDC_PRESERVE, m_bPreserve, _T("PreserveRatio") );
  81.     DDX_Check(pDX, IDC_PRESERVE, m_bPreserve);
  82.     DDP_Text(pDX, IDC_EDIT1, m_strCaption, _T("Caption") );
  83.     DDX_Text(pDX, IDC_EDIT1, m_strCaption);
  84.     //}}AFX_DATA_MAP
  85.     DDP_PostProcessing(pDX);
  86. }
  87.  
  88.  
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CAccessPictPropPage message handlers
  91.  
  92. void CAccessPictPropPage::OnStretch()
  93. {
  94.     // TODO: Add your control notification handler code here
  95.  
  96. }
  97.