home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / VFORM.ZIP / Samples / vfTest / Example1Dlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-10  |  2.0 KB  |  81 lines

  1. // -------------------------------------------------------------------------
  2. // Copyright @ 1997 TCK Software, Incorporated
  3. // All Rights Reserved
  4. // -------------------------------------------------------------------------
  5. // Example1Dlg.cpp : implementation file
  6. //
  7.  
  8. #include "stdafx.h"
  9. #include "vftest.h"
  10. #include "Example1Dlg.h"
  11.  
  12. #ifdef _DEBUG
  13. #define new DEBUG_NEW
  14. #undef THIS_FILE
  15. static char THIS_FILE[] = __FILE__;
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CExample1Dlg dialog
  20.  
  21.  
  22. CExample1Dlg::CExample1Dlg(CWnd* pParent /*=NULL*/)
  23.     : CDialog(CExample1Dlg::IDD, pParent)
  24. {
  25.     //{{AFX_DATA_INIT(CExample1Dlg)
  26.         // NOTE: the ClassWizard will add member initialization here
  27.     //}}AFX_DATA_INIT
  28. }
  29.  
  30.  
  31. void CExample1Dlg::DoDataExchange(CDataExchange* pDX)
  32. {
  33.     CDialog::DoDataExchange(pDX);
  34.     //{{AFX_DATA_MAP(CExample1Dlg)
  35.         // NOTE: the ClassWizard will add DDX and DDV calls here
  36.     //}}AFX_DATA_MAP
  37.  
  38.     // ------ Must Match up control to class (does SubclassWindow())
  39.     // DDX_Control(pDX, IDC_VFORM1, m_ctlTestVF);
  40. }
  41.  
  42.  
  43. BEGIN_MESSAGE_MAP(CExample1Dlg, CDialog)
  44.     //{{AFX_MSG_MAP(CExample1Dlg)
  45.     ON_WM_CREATE()
  46.     //}}AFX_MSG_MAP
  47. END_MESSAGE_MAP()
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CExample1Dlg message handlers
  51.  
  52. BOOL CExample1Dlg::OnInitDialog() 
  53. {
  54.     CDialog::OnInitDialog();
  55.  
  56.     m_ctlTestVF.SubclassDlgItem(IDC_VFORM1, this);    
  57.     m_ctlTestVF.Init();
  58.  
  59.     VBitmap* pBmp = m_ctlTestVF.GetBmp();
  60.     if (pBmp) 
  61.     {
  62.         if (!m_palMsgHandler.IsHooked())
  63.             m_palMsgHandler.Install(this, pBmp->GetPalette());
  64.         m_palMsgHandler.DoRealizePalette(m_hWnd==::GetFocus());
  65.     }    
  66.     
  67.     return TRUE;  // return TRUE unless you set the focus to a control
  68.                   // EXCEPTION: OCX Property Pages should return FALSE
  69. }
  70.  
  71. int CExample1Dlg::OnCreate(LPCREATESTRUCT lpCreateStruct) 
  72. {
  73.     // m_ctlTestVF.SubclassDlgItem(IDC_VFORM1, this);
  74.     if (CDialog::OnCreate(lpCreateStruct) == -1)
  75.         return -1;
  76.     
  77.     // TODO: Add your specialized creation code here
  78.     
  79.     return 0;
  80. }
  81.