InputPsw.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // InputPsw.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "LYFZSendMsg.h"
  5. #include "InputPsw.h"
  6. #include "mysqldata.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // InputPsw dialog
  14. InputPsw::InputPsw(CWnd* pParent /*=NULL*/)
  15. : CDialog(InputPsw::IDD, pParent)
  16. {
  17. //{{AFX_DATA_INIT(InputPsw)
  18. m_psw = _T("");
  19. m_psw2="werdfgt";
  20. //}}AFX_DATA_INIT
  21. }
  22. void InputPsw::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(InputPsw)
  26. DDX_Text(pDX, IDC_EDIT1, m_psw);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(InputPsw, CDialog)
  30. //{{AFX_MSG_MAP(InputPsw)
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // InputPsw message handlers
  35. void InputPsw::OnOK()
  36. {
  37. // TODO: Add extra validation here
  38. UpdateData();
  39. if(m_psw==m_psw2)
  40. CDialog::OnOK();
  41. }
  42. BOOL InputPsw::OnInitDialog()
  43. {
  44. CDialog::OnInitDialog();
  45. // TODO: Add extra initialization here
  46. GetDlgItem(IDC_EDIT1)->SetFocus();
  47. CRecordset myset(&g_db);
  48. CString sql="select psw from psw";
  49. myset.Open (CRecordset::forwardOnly, sql);
  50. myset.GetFieldValue ("psw", m_psw2);
  51. myset.Close();
  52. return false; // return TRUE unless you set the focus to a control
  53. // EXCEPTION: OCX Property Pages should return FALSE
  54. }