www.pudn.com > FEMS.rar > PswDlg.cpp


// PswDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "FEMS.h" 
#include "PswDlg.h" 
#include "PswRecSet.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CPswDlg dialog 
 
 
CPswDlg::CPswDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CPswDlg::IDD, pParent) 
{ 
	EnableAutomation(); 
 
	//{{AFX_DATA_INIT(CPswDlg) 
	m_password = _T(""); 
	//}}AFX_DATA_INIT 
} 
 
 
void CPswDlg::OnFinalRelease() 
{ 
	// When the last reference for an automation object is released 
	// OnFinalRelease is called.  The base class will automatically 
	// deletes the object.  Add additional cleanup required for your 
	// object before calling the base class. 
 
	CDialog::OnFinalRelease(); 
} 
 
 
BOOL CPswDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	CPswRecSet pasSet; 
	pasSet.Open(); 
	while(!pasSet.IsEOF()){ 
		m_user.AddString(pasSet.m_user); 
		pasSet.MoveNext(); 
	} 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
void CPswDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CPswDlg) 
	DDX_Control(pDX, IDC_COMUSER, m_user); 
	DDX_Text(pDX, IDC_EDITPAS, m_password); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CPswDlg, CDialog) 
	//{{AFX_MSG_MAP(CPswDlg) 
	ON_CBN_SELCHANGE(IDC_COMUSER, OnEditchangeComuser) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
BEGIN_DISPATCH_MAP(CPswDlg, CDialog) 
	//{{AFX_DISPATCH_MAP(CPswDlg) 
		// NOTE - the ClassWizard will add and remove mapping macros here. 
	//}}AFX_DISPATCH_MAP 
END_DISPATCH_MAP() 
 
// Note: we add support for IID_IPswDlg to support typesafe binding 
//  from VBA.  This IID must match the GUID that is attached to the  
//  dispinterface in the .ODL file. 
 
// {29B33AC0-6247-4E77-B277-CE8920601427} 
static const IID IID_IPswDlg = 
{ 0x29b33ac0, 0x6247, 0x4e77, { 0xb2, 0x77, 0xce, 0x89, 0x20, 0x60, 0x14, 0x27 } }; 
 
BEGIN_INTERFACE_MAP(CPswDlg, CDialog) 
	INTERFACE_PART(CPswDlg, IID_IPswDlg, Dispatch) 
END_INTERFACE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPswDlg message handlers 
 
void CPswDlg::OnEditchangeComuser()  
{ 
	// TODO: Add your control notification handler code here 
	int nIndex = m_user.GetCurSel(); 
	CPswRecSet pasSet; 
	pasSet.Open(); 
	pasSet.MoveFirst(); 
    for(int i=0;i