www.pudn.com > PBMS.rar > LogonOutDlg.cpp
// LogonOutDlg.cpp : implementation file
//
#include "stdafx.h"
#include "pbms.h"
#include "LogonOutDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLogonOutDlg dialog
CLogonOutDlg::CLogonOutDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLogonOutDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLogonOutDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CLogonOutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLogonOutDlg)
DDX_Control(pDX, IDC_COMBO1, m_comUsers);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLogonOutDlg, CDialog)
//{{AFX_MSG_MAP(CLogonOutDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLogonOutDlg message handlers
BOOL CLogonOutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
//初始化控件数据,将所有登录用户显示
int Item;
for (int i = 0; i < m_LogonUserID.GetSize(); i ++)
{
for(int j = 0; j < m_uaUsersID.GetSize(); j ++)
{
if (m_LogonUserID.GetAt(i) == m_uaUsersID.GetAt(j))
{
Item = m_comUsers.AddString(m_saUsersName.GetAt(j));
m_comUsers.SetItemData(Item,m_uaUsersID.GetAt(j));
break;
}//end-if
}//end-for(j)
}//end-for(i)
m_comUsers.SetCurSel(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CLogonOutDlg::OnOK()
{
//获取要注销的用户ID
m_userID = (int)m_comUsers.GetItemData(m_comUsers.GetCurSel());
CDialog::OnOK();
}