========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : XYCALC
========================================================================
计算器程序说明如下:
部分类的说明如下:
CAboutDlg: 关于对话框类
CColorButton:彩色按钮类
CMFECTToolTip:按钮的提示类
CCountDlg: 统计对话框类
CXYCALCDlg:标准型对话框类
CKXdlg:科学型对话框
一.对于标准型对话框:
在计算时不考虑算符优先级:可以这样处理:
定义:bool m_operavail
值为0时,输入数据,取得数据后,其值为1。
当按下运算符时,若该值为1,则计算结果,然后,将其置0。
1. 对于0~9 10个数字,共用OnClickedNumber( ) 函数。
2. 每次输入完数据后,调用updatedisp() 函数显示。
3. 按下运算符按钮后,调用perform()函数,并记下此次的运算符。每次计算刚刚输入的两个数据,不考虑优先级。运算符定义为枚举类型。
4. 设置double memoryvalue,用来存储数据于存储区。
二.对于科学型对话框:
在设计时,考虑到优先级,采用类似与堆栈的操作。
同时,由于有A.双字,字,字节三种字长,以及B.十进制,二进制,八进制,十六进制四种进制,所以,在输入,输出,计算,以及各种进制转换时都要考虑上述A,B两种情况。
1.将输入的各种进制数据转化为十进制存储,计算后,再次转化为各种进制输出。
2.输入数据时,调用clicknumber()函数,和input( )函数用来限制数据的范围。对于A~F,共用ClickNumberAF( )函数。
3.分别编写函数:enable10( ),enable2( ), enable8( ), enable16( )来控制对话框中按钮的可用性。Enablefunc( )用来控制部分函数按钮的可用性, enablecount( )用来控制统计功能按钮的可用性。
4.分别编写函数:disp16(),disp2(),disp8()用来显示各种进制的数据和结果。
5. 每次按下运算符按钮后,记下该运算符,并调用pushfh()函数。若该运算符优先级大于栈顶运算符,则压入,否则,计算完结果后,再压入。其间,考虑到括号,对其进行类似处理。
6. 对于其他运算函数,作同样处理。
7. 另外,用到统计函数,设置非模式对话框CCountDlg。设置extern CCountDlg* g_pmodless 与科学型对话框传递数据。
8. 对于菜单中的复制,粘贴,用static Cstring fuzhi 变量进行数据传递。
9. 对于按钮的颜色,用到CcolorButton类,对于按钮提示,用到CMFECTToolTip类。
三.帮助文件。
//使用HelPWorkshop 来制作。
AppWizard has created this XYCALC application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.
This file contains a summary of what you will find in each of the files that
make up your XYCALC application.
XYCALC.dsp
This file (the project file) contains information at the project level and
is used to build a single project or subproject. Other users can share the
project (.dsp) file, but they should export the makefiles locally.
XYCALC.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CXYCALCApp application class.
XYCALC.cpp
This is the main application source file that contains the application
class CXYCALCApp.
XYCALC.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
XYCALC.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.
res\XYCALC.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file XYCALC.rc.
res\XYCALC.rc2
This file contains resources that are not edited by Microsoft
Visual C++. You should place all resources not editable by
the resource editor in this file.
/////////////////////////////////////////////////////////////////////////////
AppWizard creates one dialog class:
XYCALCDlg.h, XYCALCDlg.cpp - the dialog
These files contain your CXYCALCDlg class. This class defines
the behavior of your application's main dialog. The dialog's
template is in XYCALC.rc, which can be edited in Microsoft
Visual C++.
/////////////////////////////////////////////////////////////////////////////
Help Support:
hlp\XYCALC.hpj
This file is the Help Project file used by the Help compiler to create
your application's Help file.
hlp\*.bmp
These are bitmap files required by the standard Help file topics for
Microsoft Foundation Class Library standard commands.
hlp\*.rtf
This file contains the standard help topics for standard MFC
commands and screen objects.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named XYCALC.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC42XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC42DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system.
/////////////////////////////////////////////////////////////////////////////
没有合适的资源?快使用搜索试试~ 我知道了~
Visual C++编程技巧典型案例解析上
共885个文件
h:204个
cpp:176个
txt:59个
5星 · 超过95%的资源 需积分: 9 78 下载量 86 浏览量
2009-02-20
21:39:09
上传
评论 1
收藏 6.59MB RAR 举报
温馨提示
VC++编程技巧典型案例解析(上),比较基础的教程,很适合出学者,希望对大家能有帮助
资源推荐
资源详情
资源评论
收起资源包目录
Visual C++编程技巧典型案例解析上 (885个子文件)
T_FlexGrid.aps 124KB
BmpText.aps 78KB
Viewer.aps 70KB
Viewer.aps 68KB
Viewer.aps 67KB
TextViewer.aps 51KB
Date_Search.aps 46KB
DlgBar.aps 43KB
LoadDynMenu.aps 43KB
ya.aps 40KB
demo.aps 38KB
WndBG.aps 37KB
TimerTest.aps 37KB
Control.aps 35KB
myshortcut.aps 35KB
FlashGet.aps 35KB
changepage.aps 31KB
Xycalc.aps 30KB
TestDLL.aps 29KB
Time.aps 28KB
Findhz.aps 27KB
Discourse.aps 20KB
Dll1.aps 18KB
DynMenu.aps 18KB
Saver.aps 17KB
Discount.aps 4KB
calcuDiscount.asp 638B
MakeHelp.bat 1KB
pic1.bin 0B
xy.bmp 352KB
Banner.bmp 103KB
titanic.bmp 35KB
ButtonsWin3000.bmp 18KB
Button1.bmp 5KB
Add_up.bmp 4KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
Toolbar.bmp 1KB
toolbar1.bmp 358B
toolbar1.bmp 358B
Discount_p.c 29KB
WndBG_p.c 14KB
HelloWindows.c 2KB
WndBG_i.c 1KB
Discount_i.c 1KB
ring_buffer.c 1KB
Server Socket Code.c 956B
dlldata.c 837B
dlldata.c 831B
Client Socket Code.c 723B
Example.c 267B
hello.c 77B
Hey.c 68B
client 14KB
XYCALC.clw 8KB
changepage.clw 4KB
Date_Search.clw 4KB
BmpText.clw 3KB
TestDLL.clw 3KB
Findhz.clw 3KB
DlgBar.clw 2KB
LoadDynMenu.clw 2KB
TimerTest.clw 2KB
Time.clw 2KB
My.clw 2KB
T_FlexGrid.clw 2KB
ya.clw 2KB
myshortcut.clw 1KB
Control.clw 1KB
DISCOURSE.clw 1KB
FlashGet.clw 1KB
DLL1.clw 728B
WndBG.clw 584B
DynMenu.clw 467B
KXdlg.cpp 36KB
msflexgrid.cpp 29KB
XYCALCDlg.cpp 19KB
yaDlg.cpp 17KB
Saver.cpp 14KB
rdc.cpp 12KB
T_FlexGridDlg.cpp 11KB
findhzView.cpp 10KB
SetBG.cpp 9KB
_rdoresultset.cpp 9KB
WBButton.cpp 8KB
myshortcutDlg.cpp 8KB
MFECToolTip.cpp 8KB
AutoFont.cpp 7KB
_rdoconnection.cpp 7KB
rdopreparedstatement.cpp 6KB
FlashGetDlg.cpp 6KB
共 885 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
- sjl3162014-03-20不错 很好的资料
hbalzmy
- 粉丝: 6
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 筷手引流工具.apk
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功