Files

77 lines
1.5 KiB
C++

// PWDlg.cpp : implementation file
//
#include "stdafx.h"
#include "sp.h"
#include "PWDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPWDlg dialog
CPWDlg::CPWDlg(CWnd* pParent /*=NULL*/)
: CDialog(CPWDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPWDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CPWDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPWDlg)
DDX_Control(pDX, IDC_USER, m_edUsername);
DDX_Control(pDX, IDOK, m_btnOK);
DDX_Control(pDX, IDC_PW2, m_edPW2);
DDX_Control(pDX, IDC_PW1, m_edPW1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPWDlg, CDialog)
//{{AFX_MSG_MAP(CPWDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPWDlg message handlers
void CPWDlg::PassPWString(CString *pw, CString *user)
{
strPassword=pw;
strUserName=user;
}
void CPWDlg::OnOK()
{
// TODO: Add extra validation here
CString pw1,pw2,usr;
m_edPW1.GetWindowText(pw1);
m_edPW2.GetWindowText(pw2);
m_edUsername.GetWindowText(usr);
if(usr.IsEmpty())
{
AfxMessageBox("You must enter a user login name");
return;
}
if(pw2.Compare(pw1)!=0)
{
AfxMessageBox("Password and confirmation do not match!");
return;
}
strPassword->Format("%s",pw1);
strUserName->Format("%s",usr);
CDialog::OnOK();
}