📄 connectiondlg.cpp
字号:
/////////////////////////////////////////////////////////////////
// //
// ConnectionDlg.cpp //
// implementation of the CConnectionDlg class //
//-------------------------------------------------------------//
// By Eugene Khodakovsky //
// June, 2000 //
// Eugene@cpplab.com //
// Last Update: April, 2002 //
/////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ConnectionDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CConnectionDlg dialog
CConnectionDlg::CConnectionDlg(CWnd* pParent,bool bOleDBSupport)
: CDialog(CConnectionDlg::IDD, pParent),
m_bOleDBSupport(bOleDBSupport)
{
//{{AFX_DATA_INIT(CConnectionDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_strDataSourceCaption = m_bOleDBSupport ? _T("Server") : _T("DSN:");
}
void CConnectionDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CConnectionDlg)
//}}AFX_DATA_MAP
DDX_Text(pDX, IDC_STATIC_DATASOURCE_CAPTION,m_strDataSourceCaption);
DDX_Text(pDX, IDC_EDIT_DSN_D,m_bOleDBSupport ? m_props.m_strServerName : m_props.m_strDSN);
DDX_Text(pDX, IDC_EDIT_PWD_D,m_props.m_strPassword);
DDX_Text(pDX, IDC_EDIT_UID_D,m_props.m_strLoginName);
DDX_Text(pDX, IDC_EDIT_DATABASE_NAME,m_props.m_strDatabaseName);
}
BEGIN_MESSAGE_MAP(CConnectionDlg, CDialog)
//{{AFX_MSG_MAP(CConnectionDlg)
ON_EN_CHANGE(IDC_EDIT_DSN_D, OnChangeEdit)
ON_EN_CHANGE(IDC_EDIT_PWD_D, OnChangeEdit)
ON_EN_CHANGE(IDC_EDIT_UID_D, OnChangeEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CConnectionDlg message handlers
BOOL CConnectionDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_bInit = true;
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CConnectionDlg::OnOK()
{
UpdateData();
if(!IsValidPassword())
return;
CDialog::OnOK();
}
void CConnectionDlg::OnChangeEdit()
{
if(!m_bInit)
return;
UpdateData();
}
bool CConnectionDlg::IsValidPassword()
{
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -