check1.cpp

来自「一个模仿ATM提款机的MFC程序」· C++ 代码 · 共 91 行

CPP
91
字号
// Check1.cpp : implementation file
//

#include "stdafx.h"
#include "ATM.h"
#include "Check1.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCheck dialog


CCheck::CCheck(CWnd* pParent /*=NULL*/)
	: CDialog(CCheck::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCheck)
	m_Availbal = 0.0;
	m_Balance = 0.0;
	//}}AFX_DATA_INIT
}


void CCheck::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCheck)
	DDX_Text(pDX, IDC_AVAILABLE_BALANCE, m_Availbal);
	DDX_Text(pDX, IDC_BALANCE, m_Balance);
	//}}AFX_DATA_MAP
	SetTimer(0,15000,NULL);
}


BEGIN_MESSAGE_MAP(CCheck, CDialog)
	//{{AFX_MSG_MAP(CCheck)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCheck message handlers

void CCheck::OnCancel() 
{
	// TODO: Add extra cleanup here
	CurrentAcnt::storageC();
	CPhoneuser::storageP();
	Exaccount::storageE();
	CEnd endlg;
	endlg.DoModal();
	exit(0);
	
	CDialog::OnCancel();
}

void CCheck::OnOK() 
{
	// TODO: Add extra validation here
	
	CDialog::OnOK();
}

BOOL CCheck::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	switch(pMsg->message)
	{
	case WM_KEYUP:SetTimer(0,15000,NULL);break;
	case WM_KEYDOWN:KillTimer(0);break;
	}

	
	return CDialog::PreTranslateMessage(pMsg);
}

void CCheck::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	Beep(1000,500);
	KillTimer(0);
	CAlarm alarmdlg;
	alarmdlg.DoModal();
	
	CDialog::OnTimer(nIDEvent);
}

⌨️ 快捷键说明

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