欢迎来到天天文库
浏览记录
ID:50831170
大小:48.00 KB
页数:14页
时间:2020-03-15
《vc6.0中用MFC编写计算器代码.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、//CKcalculateDlg.cpp:implementationfile//#include"stdafx.h"#include"math.h"#include"CKcalculate.h"#include"CKcalculateDlg.h"#ifdef_DEBUG#definenewDEBUG_NEW#undefTHIS_FILEstaticcharTHIS_FILE[]=__FILE__;#endif//doublem_first;//存储一次运算的第一个操作数及一次运算的结果//doublem_second;//存储一次运算的第二个操作数//CStringm_operator;/
2、/存储运算符//doublem_coff;//存储小数点的系数权值///////////////////////////////////////////////////////////////////////////////CAboutDlgdialogusedforAppAbout/////////////////////////////////////////////////////////////////////////////classCAboutDlg:publicCDialog{public:CAboutDlg();//DialogData//{{AFX_DATA(CAboutD
3、lg)enum{IDD=IDD_ABOUTBOX};//}}AFX_DATA//ClassWizardgeneratedvirtualfunctionoverrides//{{AFX_VIRTUAL(CAboutDlg)protected:virtualvoidDoDataExchange(CDataExchange*pDX);//DDX/DDVsupport//}}AFX_VIRTUAL//Implementationprotected://{{AFX_MSG(CAboutDlg)//}}AFX_MSGDECLARE_MESSAGE_MAP()};CAboutDlg::CAboutDlg(
4、):CDialog(CAboutDlg::IDD){//{{AFX_DATA_INIT(CAboutDlg)//}}AFX_DATA_INIT}voidCAboutDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CAboutDlg)//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CAboutDlg,CDialog)//{{AFX_MSG_MAP(CAboutDlg)//Nomessagehandlers//}}AFX_MSG_MAPEND_MESSA
5、GE_MAP()///////////////////////////////////////////////////////////////////////////////CCKcalculateDlgdialogCCKcalculateDlg::CCKcalculateDlg(CWnd*pParent/*=NULL*/):CDialog(CCKcalculateDlg::IDD,pParent){//voidUpdateDisplay(double);//voidCalculate(void);//{{AFX_DATA_INIT(CCKcalculateDlg)/////////////
6、////////////////////////////////////////////////////////////////////////////////////////isXdeY=false;m_display=_T("");m_PI=3.14159265358979323846;m_first=0.0;m_second=0.0;m_operator=_T("+");m_coff=0;m_display=_T("0.0");//}}AFX_DATA_INIT//NotethatLoadIcondoesnotrequireasubsequentDestroyIconinWin32m_
7、hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);}voidCCKcalculateDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCKcalculateDlg)DDX_Text(pDX,IDC_DISPLAY,m_display);//}}AFX_D
此文档下载收益归作者所有