maindialog.cpp

来自「采用MFC来实现QQ界面设计」· C++ 代码 · 共 68 行

CPP
68
字号
// MainDialog.cpp : implementation file
//

#include "stdafx.h"
#include "myqq.h"
#include "MainDialog.h"
#include "MyQQDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainDialog dialog


CMainDialog::CMainDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CMainDialog::IDD, pParent)
{
	
	//{{AFX_DATA_INIT(CMainDialog)
	m_qqnum = _T("");
	m_password = _T("");
	//}}AFX_DATA_INIT
}


void CMainDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMainDialog)
	DDX_CBString(pDX, IDC_COMBO1, m_qqnum);
	DDX_Text(pDX, IDC_EDIT1, m_password);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMainDialog, CDialog)
	//{{AFX_MSG_MAP(CMainDialog)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMainDialog message handlers

void CMainDialog::OnOK() 
{
	// TODO: Add extra validation here

	CDialog::OnOK();
		UpdateData(true);
	if(m_qqnum=='1' && m_password=='1')
	{
		CMyQQDlg dlg;
		dlg.DoModal();
	}
	else MessageBox("QQ号或密码错误");
}

void CMainDialog::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?