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

  1. // DlgSQL.cpp : implementation file
  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 "DaoView.h"
  15. #include "DlgSQL.h"
  16.  
  17. #ifdef _DEBUG
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CDlgSQL dialog
  24.  
  25.  
  26. CDlgSQL::CDlgSQL(CWnd* pParent /*=NULL*/)
  27.     : CDialog(CDlgSQL::IDD, pParent)
  28. {
  29.     //{{AFX_DATA_INIT(CDlgSQL)
  30.     m_strName = _T("");
  31.     m_strSQL = _T("");
  32.     //}}AFX_DATA_INIT
  33.     m_bEditMode = FALSE;
  34. }
  35.  
  36.  
  37. void CDlgSQL::DoDataExchange(CDataExchange* pDX)
  38. {
  39.     CDialog::DoDataExchange(pDX);
  40.     //{{AFX_DATA_MAP(CDlgSQL)
  41.     DDX_Text(pDX, IDC_EDITNAME, m_strName);
  42.     DDV_MaxChars(pDX, m_strName, 45);
  43.     DDX_Text(pDX, IDC_EDITSQL, m_strSQL);
  44.     //}}AFX_DATA_MAP
  45. }
  46.  
  47.  
  48. BEGIN_MESSAGE_MAP(CDlgSQL, CDialog)
  49.     //{{AFX_MSG_MAP(CDlgSQL)
  50.     //}}AFX_MSG_MAP
  51. END_MESSAGE_MAP()
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CDlgSQL message handlers
  55.  
  56. BOOL CDlgSQL::OnInitDialog()
  57. {
  58.     CDialog::OnInitDialog();
  59.  
  60.     if (m_bEditMode)
  61.     {
  62.         ((CEdit *) GetDlgItem(IDC_EDITNAME))->SetReadOnly();
  63.         ((CEdit *) GetDlgItem(IDC_EDITSQL))->SetFocus();
  64.     }
  65.  
  66.     return TRUE;  // return TRUE unless you set the focus to a control
  67.                   // EXCEPTION: OCX Property Pages should return FALSE
  68. }
  69.