欢迎来到天天文库
浏览记录
ID:34726753
大小:101.68 KB
页数:14页
时间:2019-03-10
《vc6.0中用mfc编写计算器代码》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
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_se
2、cond;//存储一次运算的第二个操作数//CStringm_operator;//存储运算符//doublem_coff;//存储小数点的系数权值///////////////////////////////////////////////////////////////////////////////CAboutDlgdialogusedforAppAbout///////////////////////////////////////////////////////////////////////////
3、//classCAboutDlg:publicCDialog{public:CAboutDlg();//DialogData//{{AFX_DATA(CAboutDlg)enum{IDD=IDD_ABOUTBOX};//}}AFX_DATA//ClassWizardgeneratedvirtualfunctionoverrides//{{AFX_VIRTUAL(CAboutDlg)protected:virtualvoidDoDataExchange(CDataExchange*pDX);//DDX/DDVsu
4、pport//}}AFX_VIRTUAL//Implementationprotected://{{AFX_MSG(CAboutDlg)//}}AFX_MSGDECLARE_MESSAGE_MAP()};CAboutDlg::CAboutDlg():CDialog(CAboutDlg::IDD){//{{AFX_DATA_INIT(CAboutDlg)//}}AFX_DATA_INIT}voidCAboutDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDat
5、aExchange(pDX);//{{AFX_DATA_MAP(CAboutDlg)//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CAboutDlg,CDialog)//{{AFX_MSG_MAP(CAboutDlg)//Nomessagehandlers//}}AFX_MSG_MAPEND_MESSAGE_MAP()///////////////////////////////////////////////////////////////////////////////CCKcalc
6、ulateDlgdialogCCKcalculateDlg::CCKcalculateDlg(CWnd*pParent/*=NULL*/):CDialog(CCKcalculateDlg::IDD,pParent){//voidUpdateDisplay(double);//voidCalculate(void);//{{AFX_DATA_INIT(CCKcalculateDlg)//////////////////////////////////////////////////////////////////
7、///////////////////////////////////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_hIcon=AfxGet
8、App()->LoadIcon(IDR_MAINFRAME);}voidCCKcalculateDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCKcalculateDlg)DDX_Text(pDX,IDC_DISPLAY,m_display);//}}AFX_D
此文档下载收益归作者所有