资源简介
上次写的计算器bug太多,有点不满意,这次进行了一下修改,这是简单计算器没实现科学计算器不需要用那么多math函数,并且加了比较完整的注释,仅供参考。

代码片段和文件信息
// CalculatorDemoDlg.cpp : implementation file
//
#include “stdafx.h“
#include “TestCalculatorDemo.h“
#include “CalculatorDemoDlg.h“
#include “math.h“
#include “string“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCalculatorDemoDlg dialog
CCalculatorDemoDlg::CCalculatorDemoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCalculatorDemoDlg::IDD pParent)
{
//{{AFX_DATA_INIT(CCalculatorDemoDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCalculatorDemoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCalculatorDemoDlg)
DDX_Control(pDX IDC_EDIT_SHOW m_edit_show);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCalculatorDemoDlg CDialog)
//{{AFX_MSG_MAP(CCalculatorDemoDlg)
ON_BN_CLICKED(IDC_BTN_NO1 OnBtnNo1)
ON_BN_CLICKED(IDC_BTN_NO2 OnBtnNo2)
ON_BN_CLICKED(IDC_BTN_NO3 OnBtnNo3)
ON_BN_CLICKED(IDC_BTN_NO4 OnBtnNo4)
ON_BN_CLICKED(IDC_BTN_NO5 OnBtnNo5)
ON_BN_CLICKED(IDC_BTN_NO6 OnBtnNo6)
ON_BN_CLICKED(IDC_BTN_NO7 OnBtnNo7)
ON_BN_CLICKED(IDC_BTN_NO8 OnBtnNo8)
ON_BN_CLICKED(IDC_BTN_NO9 OnBtnNo9)
ON_BN_CLICKED(IDC_BTN_NO0 OnBtnNo0)
ON_BN_CLICKED(IDC_BTN_PORT OnBtnPort)
ON_BN_CLICKED(IDC_BTN_ADD OnBtnAdd)
ON_BN_CLICKED(IDC_BTN_SUB OnBtnSub)
ON_BN_CLICKED(IDC_BTN_MUL OnBtnMul)
ON_BN_CLICKED(IDC_BTN_DIV OnBtnDiv)
ON_BN_CLICKED(IDC_BTN_EQUEL OnBtnEquel)
ON_BN_CLICKED(IDC_BTN_PERCENT OnBtnPercent)
ON_BN_CLICKED(IDC_BTN_DOWN OnBtnDown)
ON_BN_CLICKED(IDC_BTN_NEQUA OnBtnNequa)
ON_BN_CLICKED(IDC_BTN_SPACE OnBtnSpace)
ON_BN_CLICKED(IDC_BTN_C OnBtnC)
ON_BN_CLICKED(IDC_BTN_SQRT OnBtnSqrt)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCalculatorDemoDlg message handlers
// 1
void CCalculatorDemoDlg::OnBtnNo1()
{
// TODO: Add your control notification handler code here
PutIntoNum(1);
}
// 2
void CCalculatorDemoDlg::OnBtnNo2()
{
// TODO: Add your control notification handler code here
PutIntoNum(2);
}
// 3
void CCalculatorDemoDlg::OnBtnNo3()
{
// TODO: Add your control notification handler code here
PutIntoNum(3);
}
// 4
void CCalculatorDemoDlg::OnBtnNo4()
{
// TODO: Add your control notification handler code here
PutIntoNum(4);
}
// 5
void CCalculatorDemoDlg::OnBtnNo5()
{
// TODO: Add your control notification handler code here
PutIntoNum(5);
}
// 6
void CCalculatorDemoDlg::OnBtnNo6()
{
// TODO: Add your control notification handler code here
PutIntoNum(6);
}
// 7
void CCalculatorDemoDlg::OnBtnNo7()
{
// TODO: Add your control notification handler code here
PutIntoNum(7);
}
// 8
void CCalculatorDemoDlg::OnBtnNo8()
{
// TODO: Add your control notification handler code here
PutIntoNum(8);
}
//
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1256 2011-09-19 16:24 注意.txt
文件 49664 2011-09-18 21:33 TestCalculatorDemo\TestCalculatorDemo.opt
文件 3795 2011-09-11 01:36 TestCalculatorDemo\ReadMe.txt
文件 542 2011-09-11 17:17 TestCalculatorDemo\TestCalculatorDemo.dsw
文件 6899 2011-09-18 21:11 TestCalculatorDemo\TestCalculatorDemo.rc
文件 2221 2011-09-18 20:40 TestCalculatorDemo\TestCalculatorDemo.cpp
文件 4364 2011-09-18 21:33 TestCalculatorDemo\TestCalculatorDemo.dsp
文件 1054 2011-09-11 01:36 TestCalculatorDemo\StdAfx.h
文件 220 2011-09-11 01:36 TestCalculatorDemo\StdAfx.cpp
文件 66560 2011-09-18 21:33 TestCalculatorDemo\TestCalculatorDemo.ncb
文件 2324 2011-09-19 19:05 TestCalculatorDemo\TestCalculatorDemo.clw
文件 37148 2011-09-18 21:11 TestCalculatorDemo\TestCalculatorDemo.aps
文件 11587 2011-09-19 19:05 TestCalculatorDemo\CalculatorDemoDlg.cpp
文件 2829 2011-09-19 19:04 TestCalculatorDemo\CalculatorDemoDlg.h
文件 1799 2011-09-11 01:42 TestCalculatorDemo\Resource.h
文件 1483 2011-09-19 19:05 TestCalculatorDemo\TestCalculatorDemo.plg
文件 1457 2011-09-11 02:10 TestCalculatorDemo\TestCalculatorDemo.h
文件 3452 2011-09-19 19:05 TestCalculatorDemo\Debug\TestCalculatorDemo.res
文件 254976 2011-09-19 19:05 TestCalculatorDemo\Debug\vc60.idb
文件 5500532 2011-09-11 17:21 TestCalculatorDemo\Debug\TestCalculatorDemo.pch
文件 438272 2011-09-19 19:05 TestCalculatorDemo\Debug\vc60.pdb
文件 105581 2011-09-11 17:21 TestCalculatorDemo\Debug\StdAfx.obj
文件 410624 2011-09-19 19:05 TestCalculatorDemo\Debug\TestCalculatorDemo.pdb
文件 114765 2011-09-19 19:05 TestCalculatorDemo\Debug\TestCalculatorDemo.exe
文件 23331 2011-09-18 20:06 TestCalculatorDemo\Debug\TestCalculatorDemoDlg.obj
文件 240152 2011-09-19 19:05 TestCalculatorDemo\Debug\TestCalculatorDemo.ilk
文件 51962 2011-09-19 19:05 TestCalculatorDemo\Debug\CalculatorDemoDlg.obj
文件 14596 2011-09-19 19:05 TestCalculatorDemo\Debug\TestCalculatorDemo.obj
文件 410 2011-09-11 01:36 TestCalculatorDemo\res\TestCalculatorDemo.rc2
文件 1078 2011-09-11 01:36 TestCalculatorDemo\res\TestCalculatorDemo.ico
............此处省略6个文件信息
- 上一篇:对声卡音频数据采集,实时显示波形
- 下一篇:学生成绩管理系统C++附报告
相关资源
- 基于MFC的TCP调试助手源码95706
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- 基于mfc的多线程文件传输
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- MFC数字钟(基于VC6.0)
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- ChartCtrl控件库(可在VS2019中使用)
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
评论
共有 条评论