?? logindlg.cpp
字號:
// LoginDlg.cpp : implementation file
//
#include "stdafx.h"
#include "廢品收購管理系統.h"
#include "LoginDlg.h"
#include "MainDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLoginDlg dialog
CLoginDlg::CLoginDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLoginDlg::IDD, pParent)
{
EnableAutomation();
//{{AFX_DATA_INIT(CLoginDlg)
m_pwd = _T("");
m_user = _T("");
//}}AFX_DATA_INIT
}
void CLoginDlg::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();
}
void CLoginDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLoginDlg)
DDX_Text(pDX, IDC_PWD, m_pwd);
DDX_Text(pDX, IDC_USER, m_user);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLoginDlg, CDialog)
//{{AFX_MSG_MAP(CLoginDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CLoginDlg, CDialog)
//{{AFX_DISPATCH_MAP(CLoginDlg)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_ILoginDlg to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {E555CA8C-A60B-4445-A77B-CB9CAA78944E}
static const IID IID_ILoginDlg =
{ 0xe555ca8c, 0xa60b, 0x4445, { 0xa7, 0x7b, 0xcb, 0x9c, 0xaa, 0x78, 0x94, 0x4e } };
BEGIN_INTERFACE_MAP(CLoginDlg, CDialog)
INTERFACE_PART(CLoginDlg, IID_ILoginDlg, Dispatch)
END_INTERFACE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLoginDlg message handlers
//DEL void CLoginDlg::OnEnter()
//DEL {
//DEL // TODO: Add your control notification handler code here
//DEL CoInitialize(NULL);
//DEL _ConnectionPtr pCon(_uuidof(Connection));
//DEL _RecordsetPtr pRec(_uuidof(Recordset));
//DEL
//DEL pCon->ConnectionTimeout=5;
//DEL pCon->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=廢品交易數據庫.mdb","","",adModeUnknown);
//DEL
//DEL CString strSQL;
//DEL UpdateData(TRUE);
//DEL strSQL.Format("SELECT * FROM 用戶名與密碼表 WHERE 用戶名='%s' AND 密碼='%s'",m_user,m_pwd);
//DEL
//DEL pRec->Open(_bstr_t(strSQL),
//DEL _variant_t((IDispatch*)pCon,true),
//DEL adOpenStatic,
//DEL adLockOptimistic,
//DEL adCmdText
//DEL );
//DEL
//DEL if(pRec->GetRecordCount()==0)
//DEL {
//DEL m_user="";
//DEL m_pwd="";
//DEL UpdateData(FALSE);
//DEL MessageBox("輸入用戶名或密碼錯誤!");
//DEL
//DEL }
//DEL else
//DEL {
//DEL OnOK();
//DEL CMainDlg MainDlg;
//DEL MainDlg.DoModal();
//DEL
//DEL }
//DEL pRec->Close();
//DEL pCon->Close();
//DEL pRec.Release();
//DEL pCon.Release();
//DEL CoUninitialize();
//DEL
//DEL }
BOOL CLoginDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -