// InputPsw.cpp : implementation file // #include "stdafx.h" #include "LYFZIPManage.h" #include "InputPsw.h" #include "mysqldata.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // InputPsw dialog InputPsw::InputPsw(CWnd* pParent /*=NULL*/) : CDialog(InputPsw::IDD, pParent) { //{{AFX_DATA_INIT(InputPsw) m_psw = _T(""); m_psw2="werdfgt"; //}}AFX_DATA_INIT } void InputPsw::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(InputPsw) DDX_Text(pDX, IDC_EDIT1, m_psw); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(InputPsw, CDialog) //{{AFX_MSG_MAP(InputPsw) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // InputPsw message handlers void InputPsw::OnOK() { // TODO: Add extra validation here UpdateData(); if(m_psw==m_psw2) CDialog::OnOK(); } BOOL InputPsw::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here GetDlgItem(IDC_EDIT1)->SetFocus(); MyLock lock("xiaoaccessdbmsg"); CRecordset myset(&g_db); CString sql="select psw from psw"; myset.Open (CRecordset::forwardOnly, sql); myset.GetFieldValue ("psw", m_psw2); myset.Close(); return false; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }