百度文库地址:https://wenku.baidu.com/view/12e8170902020740be1e9bd7

Windows大作业报告

课程名称:windows程序设计

所属学院:计算机学院

所属班级:软件113班

原 创   :刘东彦

指导老师:陆筱霞

完成日期:2012年12月3日

Windows大作业报告

目录

目录​1

一.作者信息​5

二.准备工作​5

1.建立工程​5

2.准备图片​6

3. 添加位图​7

三.设计钟表和电子钟​9

1.创建对话框CMyDialog1​9

2. 设计CMyDialog1​9

3. 关联变量​12

4.添加成员变量​14

4. 添加静态成员变量​15

5. 初始化静态成员变量:​15

6. 添加消息处理函数​16

7. 编写CMyDialog1::OnButton2() 消息处理函数:​17

8. 编写CMyDialog1::OnButton3() 消息处理函数:​17

9. 编写CMyDialog1::OnButton4() 消息处理函数:​17

10. 编写CMyDialog1::OnButton5() 消息处理函数:​18

11. 编写CMyDialog1::OnButton6() 消息处理函数:​18

12. 编写CMyDialog1::OnButton7() 消息处理函数:​18

13. 编写CMyDialog1::OnCancel()消息处理函数:​19

14. 编写CMyDialog1::OnOK()消息处理函数:​19

15. 编写CMyDialog1::OnPaint() 消息处理函数:​19

16. 编写CMyDialog1::OnTimer() 消息处理函数:​24

17. 编写CMyDialog1::OnInitDialog()  消息处理函数:​24

18. 编写CMyDialog1::OnRadio1()  消息处理函数:​25

19. 编写CMyDialog1::OnRadio2()  消息处理函数:​25

20. 编写CMyDialog1::OnButton1()  消息处理函数​25

21. 添加头文件​25

四.设计计算器的出错提示​26

1. 创建对话框CMyDialog0​26

2.设计CMyDialog0​26

3.创建新类​27

五.设计计算器​27

1.创建对话框CDialog2​27

2.设计CDialog2​27

3.关联变量​30

4.添加成员变量和静态成员变量​30

5.初始化静态成员变量和定义静态全局变量:​31

6.添加消息处理函数​31

7.编写CDialog2::OnButton1()的处理函数​33

8.编写CDialog2::OnButton0()的处理函数​33

9.编写CDialog2::OnButton10x()的处理函数​34

10.编写CDialog2::OnButton2()的处理函数​34

11.编写CDialog2::OnButton3()的处理函数​35

12.编写CDialog2::OnButton3x()的处理函数​35

13.编写CDialog2::OnButton4()的处理函数​36

14.编写CDialog2::OnButton5()的处理函数​36

15.编写CDialog2::OnButton6()的处理函数​37

16.编写CDialog2::OnButton7()的处理函数​37

17.编写CDialog2::OnButton8()的处理函数​38

18.编写CDialog2::OnButton9()的处理函数​38

19.编写CDialog2::OnButtonAcos()的处理函数​38

21.编写CDialog2::OnButtonAdd()的处理函数​39

22.编写CDialog2::OnButtonAsin()的处理函数​40

23.编写CDialog2::OnButtonAtan()的处理函数​41

24.编写CDialog2::OnButtonC()的处理函数​41

25.编写CDialog2::OnButtonCe()的处理函数​41

26.编写CDialog2::OnButtonCos()的处理函数​42

27.编写CDialog2::OnButtonCosh()的处理函数​43

28.编写CDialog2::OnButtonDe()的处理函数​43

29.编写CDialog2::OnButtonDiv()的处理函数​44

30.编写CDialog2::OnButtonEq()的处理函数​44

31.编写CDialog2::OnButtonExq()的处理函数​46

32.编写CDialog2::OnButtonInt()的处理函数​46

33.编写CDialog2::OnButtonLn()的处理函数​47

34.编写CDialog2::OnButtonLog()的处理函数​48

35.编写CDialog2::OnButtonM1()的处理函数​48

36.编写CDialog2::OnButtonM2()的处理函数​49

37.编写CDialog2::OnButtonMc()的处理函数​49

38.编写CDialog2::OnButtonMod()的处理函数​50

39.编写CDialog2::OnButtonMr()的处理函数​50

40.编写CDialog2::OnButtonMs()的处理函数​51

41.编写CDialog2::OnButtonM1()的处理函数​51

42.编写CDialog2::OnButtonN()的处理函数​52

43.编写CDialog2::OnButtonPer()的处理函数​52

44.编写CDialog2::OnButtonPi()的处理函数​53

45.编写CDialog2::OnButtonRe()的处理函数​53

46.编写CDialog2::OnButtonSin()的处理函数​54

47.编写CDialog2::OnButtonSinh()的处理函数​55

48.编写CDialog2::OnButtonSqroot()的处理函数​55

49.编写CDialog2::OnButtonSu()的处理函数​56

50.编写CDialog2::OnButtonTan()的处理函数​56

51.编写CDialog2::OnButtonTanh()的处理函数​57

52.编写CDialog2::OnButtonX2()的处理函数​58

53.编写CDialog2::OnButtonX3()的处理函数​58

54.编写CDialog2::OnButtonXy()的处理函数​59

55.编写CDialog2::OnButtonYx()的处理函数​59

56.编写CDialog2::OnButtond()的处理函数​60

57.编写CDialog2::OnInitDialog()的处理函数​60

58.编写CDialog2::OnButtonFa()的处理函数​61

59.编写CDialog2::OnRadio3()的处理函数​61

60.编写CDialog2::OnRadio4()的处理函数​62

61.编写CDialog2::OnRadio5()的处理函数​62

62.编写CDialog2::OnCtlColor()的处理函数​62

63.编写CDialog2::OnCancel() 的处理函数​62

64.编写CDialog2::OnCancel() 的处理函数​63

65.编写计算n!的函数​63

66.添加头文件​63

六.设计日期和天数计算​64

1.创建对话框CDialog3​64

2.设计CDialog3​64

3.关联变量​65

4.添加成员变量​66

5.添加消息处理函数​67

6. 编写CDialog3::OnButtonCacl1()消息处理函数:​67

7. 编写CDialog3::OnButtonCacl2()消息处理函数:​71

8. 编写CDialog3::OnRadio1()消息处理函数:​73

9. 编写CDialog3::OnRadio2()消息处理函数:​73

10. 编写CDialog3::OnInitDialog() 消息处理函数:​73

11. 编写CDialog3::OnCancel() 消息处理函数:​73

12. 编写CDialog3::OnButton2() 消息处理函数:​74

13.添加头文件​74

七.设计作者信息​74

1.创建对话框CDialog4​74

2.设计CDialog4​75

3. 添加消息处理函数​76

4. 编写CDialog4:::OnCancel() 消息处理函数:​76

八.设计调用(主目录)​76

1. 设置字体和标题​76

2.设计IDD_CWINDOWSDAZUOYE_DIALOG对话框​76

3.添加消息处理函数​77

4. 编写CCWindowsDazuoyeDlg::OnButton1() 消息处理函数:​78

5. 编写CCWindowsDazuoyeDlg::OnButtonCacl() 消息处理函数:​78

6. 编写CCWindowsDazuoyeDlg::OnButton2() 消息处理函数:​78

7. 编写CCWindowsDazuoyeDlg::OnButton3() 消息处理函数:​78

8.添加头文件​79

九.运行程序(部分截图)​79

十.程序调试及修改​81

十一.总结​81

十二. 致谢​82

一.作者信息

所属学院:计算机学院

所属专业:软件工程

所属班级:软件113班

指导老师:陆筱霞

课程名称:windows程序设计

所属小组:软件113班第二组

   原创作者:刘东彦

**************************************************

二.准备工作

1.建立工程

在Visual C++ 6.0中,选择“文件”→“新建”(或者使用快捷键“ctrl+N”→“工程”→选定“MFC AppWizard(.exe)”,输入工程名(名字可以为任意名字,比如我们的工程名称为“CWindowsDazuoye”)(如图 1所示)(也可以更改储存位置,比如我们的程序储存在“E:\编译\windows程序设计”,也可以使用默认),点确定→选定基本对话框(如图 2所示),然后点完成.

图 1

图 2

2.准备图片

把需要用的图片(如zxgxy.bmp(如图 3所示)和出错提示.bmp(如图 4所示))放到新建工程产生的res文件中,需要的图片如图 5所示

图 3 zxgxy.bmp             图 4 出错提示.bmp

图 3.1.2

图 5

3. 添加位图

按“Ctrl+R”(或者选择“插入”(如图 6所示)→“资源”),在弹出对话框选择“Bitmap”(或者切换到ResourceView页面,选定工程名(如图 7所示)并右击,在弹出菜单中选定“插入”在弹出对话框中选择“Bitmap”),(如图 8所示)选择引入,浏览图片,找到图片所在位置,其中在“文件类型”下拉框中选定“All Flies(*.*)”,否则无法插入一些图片,并分别按顺序添加图片“zxgxy.bmp.bmp”(如图9所示)和“出错提示.bmp”,ID分别默认名为IDB_BITMAP1,IDB_BITMAP2(可以修改ID名称,也可以使用默认,我们的程序使用的默认ID名)

图 6

图 7

图 8

图 9

三.设计钟表和电子钟

1.创建对话框CMyDialog1

按“Ctrl+R”(或者选择(或者选择“插入”(参照图 6所示)→“资源”),在弹出对话框(参照图 8所示)选择双击“Dialog”(或者切换到ResourceView页面,展开所有资源节点,单击Dialog(如图 10所示),在弹出对话框中选择“插入 Dialog”)。

并右击对话框修改其标题为“windows程序设计第二组----钟表和电子钟显示”,如图 11所示

图 10

图 11

2. 设计CMyDialog1

并按要求和表1、图 12所示内容,向对话框模板中加入控件(添加控件后,选定右击,在弹出的菜单中选择“属性”,其中第一个静态文本如图13所示和第二个静态文本如图 14所示的对话框,然后在第二个文本中可选择样式,并修改如图 15所示,其它控件可按照以上操作进行添加,需注意的是修改控件ID为“IDC_COMBO1”在数据中的输入列表项目中输入数据时,按住“ctrl+Enter”组合键换行,并不是按住“Enter”键换行,效果如图 16所示)

图 12

表 1 控件属性

控件类型

ID

标题

其他属性

静态文本

默认

电子钟显示:

默认

静态文本

IDC_STATIC_CLOCK

电子钟

在样式中的排列文本下拉框中选定居中,并选中垂直居中,凹陷和边框

静态文本

IDC_STATIC_TITLE

在样式中的排列文本下拉框中选定居中,并选中垂直居中,凹陷和边框属性

分组框

默认

时区选择

默认

组合框

IDC_COMBO1

在样式中的类型本下拉框中选定简单,并去掉分类属性,在数据中的输入列表项目中输入“ 西十二区

西十一区

零时区

东十二区”

分组框

默认

电子钟显示格式

默认

单选按钮

IDC_RADIO1

24时

默认

单选按钮

IDC_RADIO2

12时

默认

分组框

默认

改变颜色

默认

命令按钮

IDC_BUTTON2

对话框背景颜色

默认

命令按钮

IDC_BUTTON3

时针颜色

默认

命令按钮

IDC_BUTTON4

分针颜色

默认

命令按钮

IDC_BUTTON5

秒针颜色

默认

命令按钮

IDC_BUTTON6

电子钟背景颜色

默认

命令按钮

IDC_BUTTON7

电子钟字体颜色

默认

命令按钮

IDC_BUTTON1

作者信息

默认

命令按钮

IDCANCEL

返回主目录

默认

命令按钮

IDOK

结束程序

默认

图 13

图 14

图 15

图16

3. 关联变量

单击对话框,按“Ctrl+W”(或者右击,在弹出的对话框中选择“建立类向导”或者选择“查看”→“建立类向导”),在弹出的对话框(如图 17所示),选择“OK”按钮,然后建立一个新类“CMyDialog1”(可以为任意名)(如图 18所示),在弹出对话框中选择Member Variables,并按表 3.1.2所示关联变量

图 17

图 18

表 2  CMyDialog1类的控件关联变量

控件ID

变量类型

变量名

IDC_COMBO1

CComboBox

m_listBox

4.添加成员变量

切换到类视图页面,在“CMyDialog1”单击(如图 19所示),选择“Add Member Variables”,并按表 3所示添加类CMyDialog1成员变量

图 19

表 3  CMyDialog1类成员变量

变量类型

变量名称

访问权限

BOOL

m_pBool

Protected

或者项目切换到工作区间,选择头文件中“CMyDialog1.h”,在下列位置添加如下代码(红色为新加代码):

​//}}AFX_VIRTUAL

​BOOL m_pBool;

​// Generated message map functions

4. 添加静态成员变量

项目切换到工作区间,选择头文件中“CMyDialog1.h”,在下列位置添加如下代码(红色为新加代码):

​//}}AFX_VIRTUAL

protected:

​static  int m_DBkColor,m_HourColor,m_MinuteColor,

​​m_SecondColor,m_BkFontColor,m_FontColor;

​BOOL m_pBool;

​// Generated message map functions

5. 初始化静态成员变量:

项目切换到工作区间,选择头文件中“CMyDialog1.cpp”,在下列位置添加如下代码(红色为新加代码)初始化静态成员变量:

/

// CMyDialog1 dialog

//初始化所有的颜色

int CMyDialog1::m_DBkColor=int(RGB(255,100,100)),CMyDialog1::m_HourColor=int(RGB(0,0,255)),CMyDialog1::m_MinuteColor=int(RGB(0,255,0)),

​​CMyDialog1::m_SecondColor=int(RGB(200,0,0)),CMyDialog1::m_BkFontColor=int(RGB(255,255,255)),CMyDialog1::m_FontColor=int(RGB(255,0,0));

CMyDialog1::CMyDialog1(CWnd* pParent /*=NULL*/)

​: CDialog(CMyDialog1::IDD, pParent)

6. 添加消息处理函数

在类向导中按要求和表 4 CMyDialog1的控件通知消息处理函数添加消息处理函数(如图 20-1所示)

图 20-1

表 4 CMyDialog1的控件通知消息处理函数

控件ID

消息

消息处理函数

IDC_BUTTON2

BN_CLICKED

默认

IDC_BUTTON3

BN_CLICKED

默认

IDC_BUTTON4

BN_CLICKED

默认

IDC_BUTTON5

BN_CLICKED

默认

IDC_BUTTON6

BN_CLICKED

默认

IDC_BUTTON7

BN_CLICKED

默认

IDC_BUTTON1

BN_CLICKED

默认

IDCANCEL

BN_CLICKED

默认

IDOK

BN_CLICKED

默认

IDC_RADIO1

BN_CLICKED

默认

IDC_RADIO2

BN_CLICKED

默认

CMyDialog1

WM_INITDIALOG

默认

CMyDialog1

WM_PAINT

默认

CMyDialog1

WM_CTLCOLOR

默认

CMyDialog1

WM_TIMER

默认

7. 编写CMyDialog1::OnButton2() 消息处理函数:

void CMyDialog1::OnButton2()

{

​// TODO: Add your control notification handler code here

​CColorDialog dlg;

​int nRect=dlg.DoModal();

​if(nRect==IDOK)

​{

​​m_DBkColor=dlg.GetColor();

​}

}

8. 编写CMyDialog1::OnButton3() 消息处理函数:

void CMyDialog1::OnButton3()

{

​// TODO: Add your control notification handler code here

​CColorDialog dlg;

​int nRect=dlg.DoModal();

​if(nRect==IDOK)

​{

​​m_HourColor=dlg.GetColor();

​}​

}

9. 编写CMyDialog1::OnButton4() 消息处理函数:

void CMyDialog1::OnButton4()

{

​// TODO: Add your control notification handler code here

​CColorDialog dlg;

​int nRect=dlg.DoModal();

​if(nRect==IDOK)

​{

​​m_MinuteColor=dlg.GetColor();

​}​

}

10. 编写CMyDialog1::OnButton5() 消息处理函数:

void CMyDialog1::OnButton5()

{

​// TODO: Add your control notification handler code here

​CColorDialog dlg;

​int nRect=dlg.DoModal();

​if(nRect==IDOK)

​{

​​m_SecondColor=dlg.GetColor();

​}​

}

11. 编写CMyDialog1::OnButton6() 消息处理函数:

void CMyDialog1::OnButton6()

{

​// TODO: Add your control notification handler code here

​CColorDialog dlg;

​int nRect=dlg.DoModal();

​if(nRect==IDOK)

​{

​​m_BkFontColor=dlg.GetColor();

​}​

}

12. 编写CMyDialog1::OnButton7() 消息处理函数:

void CMyDialog1::OnButton7()

{

​// TODO: Add your control notification handler code here

​CColorDialog dlg;

​int nRect=dlg.DoModal();

​if(nRect==IDOK)

​{

​​m_FontColor=dlg.GetColor();

​}​

}

13. 编写CMyDialog1::OnCancel()消息处理函数:

void CMyDialog1::OnCancel()

{

​// TODO: Add extra cleanup here

​KillTimer(1);//移除定时器​

​CDialog::OnCancel();

​CCWindowsDazuoyeDlg dlg;

​dlg.DoModal();

}

14. 编写CMyDialog1::OnOK()消息处理函数:

void CMyDialog1::OnOK()

{

​// TODO: Add extra validation here

​KillTimer(1);//移除定时器

​exit(0);//结束程序

​CDialog::OnOK();

}

15. 编写CMyDialog1::OnPaint() 消息处理函数:

void CMyDialog1::OnPaint()

{

​CPaintDC dc(this); // device context for painting​

​CDC *pDC = GetDC();

​CBitmap bmp;​​// 内存中存在临时图像的位图

​CRect rect;

​GetClientRect(&rect);  //获取客户区大小

​CDC dcMem;  // 用于缓冲作图的内存

​dcMem.CreateCompatibleDC(pDC);​// 依附窗口DC创建兼容DC

​bmp.CreateCompatibleBitmap(pDC, rect.Width(), rect.Height());

​dcMem.SelectObject(&bmp);​// 将位图选入内存

​dcMem.FillSolidRect(rect,m_DBkColor);// 按照原有背景色(或自己设置的背景色)填充客户区

​dcMem.SelectObject(&bmp);​// 将位图选入内存DC

​// 绘图操作

​static const double pi=3.141592635; //得到客户区的矩形

​GetClientRect(&rect); //得到表盘中央位置,即圆心

​int x0=rect.Width()/2; //得到对话框的宽

​int y0=rect.Height()/2;//得到对话框的高

​int r=(x0>y0?y0:x0);//得到半径(以宽和高的最小值为半径)

​x0=r+55; //绘钟表图像距左边位置为55像素

​CPen Pen1;

​Pen1.CreatePen(PS_SOLID,1,RGB(255,100,0));//设置椭圆的颜色

​dcMem.SelectObject(&Pen1);

​dcMem.Ellipse(CRect(x0-r,y0-r,x0+r,y0+r)); //画最外侧的椭圆

​dcMem.Ellipse(CRect(x0-r+6,y0-r+6,x0+r-6,y0+r-6)); //画外侧的椭圆

​dcMem.Ellipse(CRect(x0-r+35,y0-r+35,x0+r-35,y0+r-35)); //画最内侧的椭圆

​CPen Pen2(PS_SOLID,3,RGB(0,0,255));//设置圆点的颜色

​dcMem.SelectObject(Pen2);  //设置椭圆的颜色

​double rate = (double)(2.0* pi/60.0); //分钟或秒针每分/秒走过角度大小 ,每刻度转过角度大小

​double halfPi=pi/2; //将要在循环中重复的计算提取出来,减少时间复杂度

​int zoomR=r-20; //绘制表盘 //zoomR 及对 zoomR 进行加或减操作主要是用来控制距离圆心的距离

​dcMem.SetBkMode(TRANSPARENT);

​for(int mark=1;mark<=60;mark++)

​{

​​int positionX = (int)(zoomR * sin(rate * mark)+ x0);

​​int positionY = (int)(-zoomR * sin(rate * mark +halfPi)+ y0);

​​if(mark%5 ==0)  //绘制数值

​​{

​​​char number[2];

​​​itoa(mark/5,number,10);//按照十进制转换

​​​dcMem.TextOut(positionX-5,positionY-5,number);

​​}

​​else   //绘制刻度

​​{

​​​dcMem.SetPixel(positionX,positionY,RGB(200,100,0));

​​​dcMem.Ellipse(positionX-2,positionY-2,positionX+2,positionY+2);

​​}

​}

​CTime time = CTime::GetCurrentTime(); //获取系统时间

​int hour=time.GetHour(); int minute= time.GetMinute(); int second= time.GetSecond();

​int year=time.GetYear();int month=time.GetMonth();int day=time.GetDay();

​int t=hour=(hour+m_listBox.GetCurSel()+4)%24;

​CString s="";char a[2];

​if(m_pBool&&t>12)

​​t=hour-12;

​if(t==0&&m_pBool)

​​t+=12;

​itoa(t,a,10);

​if(t<10)

​{

​​s.Insert(s.GetLength(),"0");

​​s.Insert(s.GetLength(),a);

​}

​else

​​s.Insert(s.GetLength(),a);

​s.Insert(s.GetLength(),":");

​itoa(minute,a,10);

​if(minute<10)

​{

​​s.Insert(s.GetLength(),"0");

​​s.Insert(s.GetLength(),a);

​}

​else

​​s.Insert(s.GetLength(),a);

​s.Insert(s.GetLength(),":");

​itoa(second,a,10);

​if(second<10)

​{

​​s.Insert(s.GetLength(),"0");

​​s.Insert(s.GetLength(),a);

​}

​else

​​s.Insert(s.GetLength(),a);

​if(m_pBool)

​{

​​if(hour>=12)

​​​SetDlgItemText(IDC_STATIC_TITLE,"pm");//在名为IDC_curtime的控件里显示字符串str

​​else

​​​SetDlgItemText(IDC_STATIC_TITLE,"am");//在名为IDC_curtime的控件里显示字符串str

​}

​else

​{

​​SetDlgItemText(IDC_STATIC_TITLE,"");//在名为IDC_curtime的控件里显示字符串str

​}

​SetDlgItemText(IDC_STATIC_CLOCK,s);//在名为IDC_curtime的控件里显示字符串str

​double hourRate=(double)(2.0*pi/12.0); //时钟每小时走过角度大小

​if(hour>12)//若时针超过12时

​{

​​hour-=12;

​}

​CPen hourPen(PS_SOLID,7,m_HourColor); //设置时针的颜色

​dcMem.SelectObject(hourPen);

​dcMem.MoveTo(CPoint(x0,y0)); //时针直线起始位置

​int hourX=(int)((zoomR-110)*sin(hourRate*(hour+minute/60.0))+x0);

​int hourY=(int)(-(zoomR-110)*sin(hourRate *(hour+minute/60.0)+halfPi)+ y0);

​dcMem. LineTo(CPoint(hourX,hourY));//时针直线结束位置

​CPen minutePen(PS_SOLID,5,m_MinuteColor); //设置分针的颜色

​dcMem.SelectObject(minutePen); //绘制分钟数指针

​dcMem.MoveTo(CPoint(x0,y0)); //分针直线起始位置

​int minuteX=(int)((zoomR-70)*sin(rate*(minute+second/60.0))+ x0);

​int minuteY=(int)(-(zoomR-70)*sin(rate*(minute+second/60.0)+halfPi)+ y0);

​dcMem.LineTo(CPoint(minuteX,minuteY)); //分针直线结束位置

​CPen secondPen(PS_SOLID,2,m_SecondColor);//设置秒针的颜色

​dcMem.SelectObject(secondPen); //绘制秒针

​dcMem.MoveTo(CPoint(x0,y0));//秒针直线起始位置

​int secondX=(int)((zoomR-25)*sin(rate*second)+x0);

​int secondY=(int)(-(zoomR-25) * sin(rate * second +halfPi)+ y0);

​dcMem.LineTo(CPoint(secondX,secondY)); //秒针直线结束位置

​pDC->BitBlt(0, 0, rect.Width(), rect.Height(),

​&dcMem, 0, 0, SRCCOPY);

​dcMem.DeleteDC();​// 删除DC

​bmp.DeleteObject();​// 删除位图

​SetTimer(1, 1000, NULL);//创建或设置一个定时器

​// TODO: Add your message handler code here

​// Do not call CDialog::OnPaint() for painting messages

}

16. 编写CMyDialog1::OnTimer() 消息处理函数:

void CMyDialog1::OnTimer(UINT nIDEvent)

{

​// TODO: Add your message handler code here and/or call default

​Invalidate(FALSE);

​CDialog::OnTimer(nIDEvent);

}

HBRUSH CMyDialog1::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)

{

​HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

​if(pWnd->GetDlgCtrlID() ==IDC_STATIC_CLOCK)

​{

​​pDC->SetTextColor(m_FontColor);//用RGB宏改变颜色

​​HBRUSH b=CreateSolidBrush(m_BkFontColor);//控件背景色

​​pDC->SetBkColor(m_BkFontColor);

​​return b;

​}

​// TODO: Change any attributes of the DC here

​// TODO: Return a different brush if the default is not desired

​return hbr;

}

17. 编写CMyDialog1::OnInitDialog()  消息处理函数:

BOOL CMyDialog1::OnInitDialog()

{

​CDialog::OnInitDialog();

​// TODO: Add extra initialization here

​m_pBool=false;

​CheckRadioButton(IDC_RADIO1,IDC_RADIO2,IDC_RADIO1);//将OnRadio1(24时)设为选中状态

​m_listBox.SetCurSel(20);//将组合框IDC_LIST1中“东八区”设为选中状态

​SetDlgItemText(IDC_STATIC_TITLE,"  ");//在名为IDC_curtime的控件里显示字符串str

​CButton* popenbtn=(CButton*)GetDlgItem(IDCANCEL);

​popenbtn->SetFocus();//设置按钮焦点在返回主目录上

​return FALSE;  // return TRUE unless you set the focus to a control

​              // EXCEPTION: OCX Property Pages should return FALSE

}

18. 编写CMyDialog1::OnRadio1()  消息处理函数:

void CMyDialog1::OnRadio1()

{

​// TODO: Add your control notification handler code here

​m_pBool=false;

}

19. 编写CMyDialog1::OnRadio2()  消息处理函数:

void CMyDialog1::OnRadio2()

{

​// TODO: Add your control notification handler code here

​m_pBool=true;

}

20. 编写CMyDialog1::OnButton1()  消息处理函数

void CMyDialog1::OnButton1()

{

​// TODO: Add your control notification handler code here

​CDialog4 dlg;

​dlg.DoModal();

}

21. 添加头文件

要想返回主目录、调用作者信息对话框和使用sin()函数,需增加头文件;项目切换到工作区间,选择头文件中“CMyDialog1.cpp”,在下列位置添加如下代码(红色为新加代码):

#include "stdafx.h"

#include "CWindowsDazuoye.h"

#include "CWindowsDazuoyeDlg.h"

#include "MyDialog1.h"

#include "Dialog4.h"//作者信息头文件,见对话框4

#include <math.h>

#ifdef _DEBUG

#define new DEBUG_NEW

四.设计计算器的出错提示
1. 创建对话框CMyDialog0

按“Ctrl+R”(或者选择“插入”→“资源”),在弹出对话框选择双击“Dialog”(或者切换到ResourceView页面,展开所有资源节点,单击Dialog,在弹出对话框中选择“插入 Dialog”)。并右击对话框修改其标题为“windows程序设计第二组--计算器---错误提示” (仿照 三.1.创建对话框CMyDialog1步骤)

2.设计CMyDialog0

删除该模板上除确定按钮以外的控件。并按要求和表5、图20-2所示内容,向对话框模板中加入控件(参照 三.2设计CMyDialog1的步骤,其中静态图片属性如图 21所示)

图 20-2

表5 控件属性

控件类型

ID

标题

其他属性

分组框

默认

温馨提示:

默认

静态文本

默认

操作有误!

默认

静态图片

默认

在类型下拉框中选择位图,图像下拉框中选择IDB_BITMAP2

命令按钮

IDOK

确定

默认

图 21

3.创建新类

单击对话框,按“Ctrl+W”(或者右击,在弹出的对话框中选择“建立类向导”或者选择“查看”→“建立类向导”),在弹出的对话框(如图 16所示),选择“OK”按钮,然后建立一个新类“CMyDialog0”(可以为任意名)。(仿照三. 3.关联变量步骤)

五.设计计算器

1.创建对话框CDialog2

按“Ctrl+R”(或者选择“插入”→“资源”),在弹出对话框选择双击“Dialog”(或者切换到ResourceView页面,展开所有资源节点,单击Dialog,在弹出对话框中选择“插入 Dialog”)。并右击对话框修改其标题为“windows程序设计第二组--计算器”(仿照 三.1.创建对话框CMyDialog1步骤)

2.设计CDialog2

并按要求和表6、图 22所示内容,向对话框模板中加入控件。(参照 三.2设计CMyDialog1的步骤)

图 22

表 6 控件属性

控件类型

ID

标题

其他属性

编辑框

IDC_EDIT1

在样式中的排列文本下拉框中选定靠右,取消自动水平滚动,选定只读和边框属性

静态文本

IDC_STATIC_MS

寄数器状态

在样式中的排列文本下拉框中选定居中,选定垂直居中和边框属性

分组框

默认

默认

单选按钮

IDC_RADIO3

角度

默认

单选按钮

IDC_RADIO4

弧度

默认

单选按钮

IDC_RADIO5

梯度

默认

命令按钮

IDC_BUTTON_M1

M+

默认

命令按钮

IDC_BUTTON_M2

M-

默认

命令按钮

IDC_BUTTON_MR

MR

默认

命令按钮

IDC_BUTTON_MS

MS

默认

命令按钮

IDC_BUTTON_SINH

sinh

默认

命令按钮

IDC_BUTTON_ASIN

asin

默认

命令按钮

IDC_BUTTON_SIN

sin

默认

命令按钮

IDC_BUTTON_DE

默认

命令按钮

IDC_BUTTON_CE

CE

默认

命令按钮

IDC_BUTTON_C

C

默认

命令按钮

IDC_BUTTON_FA

|x|

默认

命令按钮

IDC_BUTTON_MC

MC

默认

命令按钮

IDC_BUTTON_COSH

cosh

默认

命令按钮

IDC_BUTTON_ACOS

acos

默认

命令按钮

IDC_BUTTON_COS

cos

默认

命令按钮

IDC_BUTTON_7

7

默认

命令按钮

IDC_BUTTON_8

8

默认

命令按钮

IDC_BUTTON_9

9

默认

命令按钮

IDC_BUTTON_DIV

/

默认

命令按钮

IDC_BUTTON_PER

%

默认

命令按钮

IDC_BUTTON_SU

-

默认

命令按钮

IDC_BUTTON_ATAN

atan

默认

命令按钮

IDC_BUTTON_TAN

tan

默认

命令按钮

IDC_BUTTON_4

4

默认

命令按钮

IDC_BUTTON_5

5

默认

命令按钮

IDC_BUTTON_6

6

默认

命令按钮

IDC_BUTTON_MUL

*

默认

命令按钮

IDC_BUTTON_EQ

=

默认

命令按钮

IDC_BUTTON_LN

ln

默认

命令按钮

IDC_BUTTON_EXP

exp

默认

命令按钮

IDC_BUTTON_LOG

lg

默认

命令按钮

IDC_BUTTON_1

1

默认

命令按钮

IDC_BUTTON_2

2

默认

命令按钮

IDC_BUTTON_3

3

默认

命令按钮

IDC_BUTTON_N

n!

默认

命令按钮

IDC_BUTTON_MOD

取小数

默认

命令按钮

IDC_BUTTON_INT

取整

默认

命令按钮

IDC_BUTTON_0

0

默认

命令按钮

IDC_BUTTOND

.

默认

命令按钮

IDC_BUTTON_PI

π

默认

命令按钮

IDC_BUTTON_ADD

+

默认

命令按钮

IDC_BUTTON_RE

1/X

默认

命令按钮

IDC_BUTTON_X2

x^2

默认

命令按钮

IDC_BUTTON_XY

x^y

默认

命令按钮

IDC_BUTTON_10X

10^X

默认

命令按钮

IDC_BUTTON_PI

π

默认

命令按钮

IDC_BUTTON_X3

x^3

默认

命令按钮

IDC_BUTTON_SQROOT

√x

默认

命令按钮

IDC_BUTTON_3X

3√x

默认

命令按钮

IDC_BUTTON_YX

y√x

默认

命令按钮

IDOK

结束程序

默认

命令按钮

IDC_BUTTON

作者信息

默认

命令按钮

IDCANCEL

返回主目录

默认

3.关联变量

(仿照三. 3.关联变量步骤)建立新类“CDialog2”并按“表 7CTestCtrl3Dlg类的控件关联变量”关联变量

表 7 CTestCtrl3Dlg类的控件关联变量

控件ID

变量类型

变量名

IDC_EDIT1

CEdit

m_fEdit

4.添加成员变量和静态成员变量

(仿照三. 4.添加成员变量步骤和三.5.添加静态成员变量)添加代码如下(红色代码为新加代码):

​DECLARE_MESSAGE_MAP()

protected:

​static double d_op1,d_op2;//两个double型操作数

​static char ch;//表示运算符

​static CString str1[2];

​static int pBool;//角度,弧度,梯度选择

​CFont m_editFont;

};

//{{AFX_INSERT_LOCATION}}

5.初始化静态成员变量和定义静态全局变量:

(仿照三. 5.初始化静态成员变量)(红色代码)并定义静态全局变量(蓝色代码)

#endif

/

// CDialog2 dialog

int CDialog2::pBool=1;

double ms;//ms操作保存的数

int di=0;//str中小数点个数标记

static const double pi=3.14159265358979323846; //π的取值

CMyDialog0 dlg0;//出错提示

CString CDialog2::str1[2];//字符串

double CDialog2::d_op1,CDialog2::d_op2;//数值

char CDialog2::ch=' ';//运算符初始化

CDialog2::CDialog2(CWnd* pParent /*=NULL*/)

​: CDialog(CDialog2::IDD, pParent)

{

6.添加消息处理函数

(仿照三. 6.添加消息处理函数)并按照表 8  CDialog2的控件通知消息处理函数的要求

表 8  CDialog2的控件通知消息处理函数

控件ID

消息

消息处理函数

IDC_RADIO3

BN_CLICKED

默认

IDC_RADIO4

BN_CLICKED

默认

IDC_RADIO5

BN_CLICKED

默认

IDC_BUTTON_M1

BN_CLICKED

默认

IDC_BUTTON_M2

BN_CLICKED

默认

IDC_BUTTON_MR

BN_CLICKED

默认

IDC_BUTTON_MS

BN_CLICKED

默认

IDC_BUTTON_SINH

BN_CLICKED

默认

IDC_BUTTON_ASIN

BN_CLICKED

默认

IDC_BUTTON_SIN

BN_CLICKED

默认

IDC_BUTTON_DE

BN_CLICKED

默认

IDC_BUTTON_CE

BN_CLICKED

默认

IDC_BUTTON_C

BN_CLICKED

默认

IDC_BUTTON_FA

BN_CLICKED

默认

IDC_BUTTON_MC

BN_CLICKED

默认

IDC_BUTTON_COSH

BN_CLICKED

默认

IDC_BUTTON_ACOS

BN_CLICKED

默认

IDC_BUTTON_COS

BN_CLICKED

默认

IDC_BUTTON_7

BN_CLICKED

默认

IDC_BUTTON_8

BN_CLICKED

默认

IDC_BUTTON_9

BN_CLICKED

默认

IDC_BUTTON_DIV

BN_CLICKED

默认

IDC_BUTTON_PER

BN_CLICKED

默认

IDC_BUTTON_SU

BN_CLICKED

默认

IDC_BUTTON_ATAN

BN_CLICKED

默认

IDC_BUTTON_TAN

BN_CLICKED

默认

IDC_BUTTON_4

BN_CLICKED

默认

IDC_BUTTON_5

BN_CLICKED

默认

IDC_BUTTON_6

BN_CLICKED

默认

IDC_BUTTON_MUL

BN_CLICKED

默认

IDC_BUTTON_EQ

BN_CLICKED

默认

IDC_BUTTON_LN

BN_CLICKED

默认

IDC_BUTTON_EXP

BN_CLICKED

默认

IDC_BUTTON_LOG

BN_CLICKED

默认

IDC_BUTTON_1

BN_CLICKED

默认

IDC_BUTTON_2

BN_CLICKED

默认

IDC_BUTTON_3

BN_CLICKED

默认

IDC_BUTTON_N

BN_CLICKED

默认

IDC_BUTTON_MOD

BN_CLICKED

默认

IDC_BUTTON_INT

BN_CLICKED

默认

IDC_BUTTON_0

BN_CLICKED

默认

IDC_BUTTOND

BN_CLICKED

默认

IDC_BUTTON_PI

BN_CLICKED

默认

IDC_BUTTON_ADD

BN_CLICKED

默认

IDC_BUTTON_RE

BN_CLICKED

默认

IDC_BUTTON_X2

BN_CLICKED

默认

IDC_BUTTON_XY

BN_CLICKED

默认

IDC_BUTTON_10X

BN_CLICKED

默认

IDC_BUTTON_PI

BN_CLICKED

默认

IDC_BUTTON_X3

BN_CLICKED

默认

IDC_BUTTON_SQROOT

BN_CLICKED

默认

IDC_BUTTON_3X

BN_CLICKED

默认

IDC_BUTTON_YX

BN_CLICKED

默认

IDOK

BN_CLICKED

默认

IDC_BUTTON

BN_CLICKED

默认

IDCANCEL

BN_CLICKED

默认

IDC_BUTTON_X3

BN_CLICKED

默认

IDC_BUTTON_SQROOT

BN_CLICKED

默认

CDialog2

WM_INITDIALOG

默认

CDialog2

WM_CTLCOLOR

默认

7.编写CDialog2::OnButton1()的处理函数
void CDialog2::OnButton1() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'1');
​str1[0].Insert(str1[0].GetLength(),'1');
​m_Edit.SetWindowText(str1[0]);
}
8.编写CDialog2::OnButton0()的处理函数
void CDialog2::OnButton0() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'0');
​str1[0].Insert(str1[0].GetLength(),'0');
​m_Edit.SetWindowText(str1[0]);​
}
9.编写CDialog2::OnButton10x()的处理函数
void CDialog2::OnButton10x() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​int t=int(d_op1);
​if(d_op1!=t)
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=1;
​for(int i=0;i<t;i++)
​​d_op1=d_op1*10;
​str1[0].Format(_T("%18f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
10.编写CDialog2::OnButton2()的处理函数
void CDialog2::OnButton2() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'2');
​str1[0].Insert(str1[0].GetLength(),'2');
​m_Edit.SetWindowText(str1[0]);​
}
11.编写CDialog2::OnButton3()的处理函数
void CDialog2::OnButton3() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'3');
​str1[0].Insert(str1[0].GetLength(),'3');
​m_Edit.SetWindowText(str1[0]);​
}
12.编写CDialog2::OnButton3x()的处理函数
void CDialog2::OnButton3x() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=pow(d_op1,1.0/3);
​str1[0].Format(_T("%18f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';
}
13.编写CDialog2::OnButton4()的处理函数
void CDialog2::OnButton4() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'4');
​str1[0].Insert(str1[0].GetLength(),'4');
​m_Edit.SetWindowText(str1[0]);​
}
14.编写CDialog2::OnButton5()的处理函数
void CDialog2::OnButton5() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'5');
​str1[0].Insert(str1[0].GetLength(),'5');
​m_Edit.SetWindowText(str1[0]);​
}
15.编写CDialog2::OnButton6()的处理函数
void CDialog2::OnButton6() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'6');
​str1[0].Insert(str1[0].GetLength(),'6');
​m_Edit.SetWindowText(str1[0]);​
}
16.编写CDialog2::OnButton7()的处理函数
void CDialog2::OnButton7() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'7');
​str1[0].Insert(str1[0].GetLength(),'7');
​m_Edit.SetWindowText(str1[0]);​
}
17.编写CDialog2::OnButton8()的处理函数
void CDialog2::OnButton8() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'8');
​str1[0].Insert(str1[0].GetLength(),'8');
​m_Edit.SetWindowText(str1[0]);​
}
18.编写CDialog2::OnButton9()的处理函数
void CDialog2::OnButton9() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!="")
​​if(str1[1].GetAt(0)=='0'&&str1[1].GetLength()==1) 
​​{
​​​str1[1]="";
​​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取零
​​}
​str1[1].Insert(str1[1].GetLength(),'9');
​str1[0].Insert(str1[0].GetLength(),'9');
​m_Edit.SetWindowText(str1[0]);​
}
19.编写CDialog2::OnButtonAcos()的处理函数
void CDialog2::OnButtonAcos() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if(d_op1<-1||d_op1>1)
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=acos(d_op1);
​if(pBool==1)
​​d_op1=d_op1/pi*180;
​else if(pBool==3)
​​d_op1=d_op1/pi*200;
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';
}
21.编写CDialog2::OnButtonAdd()的处理函数
void CDialog2::OnButtonAdd() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​str1[1]="";
​str1[0].Insert(str1[0].GetLength(),'+');
​m_Edit.SetWindowText(str1[0]);
​ch='+';
​di=0;//小数点个数置零
}
22.编写CDialog2::OnButtonAsin()的处理函数
void CDialog2::OnButtonAsin() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if(d_op1<-1||d_op1>1)
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=asin(d_op1);
​if(pBool==1)
​​d_op1=d_op1/pi*180;
​else if(pBool==3)
​​d_op1=d_op1/pi*200;
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';
}
23.编写CDialog2::OnButtonAtan()的处理函数
void CDialog2::OnButtonAtan() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=atan(d_op1);
​if(pBool==1)
​​d_op1=d_op1/pi*180;
​else if(pBool==3)
​​d_op1=d_op1/pi*200;
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
24.编写CDialog2::OnButtonC()的处理函数
void CDialog2::OnButtonC() 
{
​// TODO: Add your control notification handler code here
​d_op1=d_op2=0;
​str1[0]=str1[1]="0";
​m_Edit.SetWindowText(str1[0]);
​ch=' ';
​di=0;//小数点个数置零
}
25.编写CDialog2::OnButtonCe()的处理函数
void CDialog2::OnButtonCe() 
{
​// TODO: Add your control notification handler code here
​if(str1[0].GetLength()==0)
​​str1[0]="0";
​else
​{
​​str1[0]=str1[0].Left(str1[0].GetLength()-str1[1].GetLength());​
​​str1[1]="";
​​if(str1[0].GetLength()==0)
​​​str1[1]=str1[0]="0";
​}
​m_Edit.SetWindowText(str1[0]);
​di=0;//小数点个数置零
}
26.编写CDialog2::OnButtonCos()的处理函数
void CDialog2::OnButtonCos() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if(pBool==1)
​​d_op1=d_op1/180*pi;
​else if(pBool==3)
​​d_op1=d_op1/200*pi;
​d_op1=cos(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
27.编写CDialog2::OnButtonCosh()的处理函数
void CDialog2::OnButtonCosh() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=cosh(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​​
}
28.编写CDialog2::OnButtonDe()的处理函数
void CDialog2::OnButtonDe() 
{
​// TODO: Add your control notification handler code here
​if(str1[0].GetLength()==1)//如果只有一位
​​str1[0]="0";
​else
​{
​​if(str1[0].GetAt(str1[0].GetLength()-1)=='+'||str1[0].GetAt(str1[0].GetLength()-1)=='-'||
​​​str1[0].GetAt(str1[0].GetLength()-1)=='*'||str1[0].GetAt(str1[0].GetLength()-1)=='/')//如果清除的是运算符
​​​ch=' ';
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);//截取
​}
​m_Edit.SetWindowText(str1[0]);
​if(ch=' ')//如果清除的是运算符
​​str1[1]=str1[0];
​di=0;//小数点个数置零
​​
}
29.编写CDialog2::OnButtonDiv()的处理函数
void CDialog2::OnButtonDiv() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​str1[1]="";
​str1[0].Insert(str1[0].GetLength(),'/');
​m_Edit.SetWindowText(str1[0]);
​ch='/';
​di=0;//小数点个数置零
}
30.编写CDialog2::OnButtonEq()的处理函数
void CDialog2::OnButtonEq() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]=="")
​{
​​dlg0.DoModal();
​​return;
​}
​else
​{
​​d_op2=atof(str1[1].GetBuffer(str1[1].GetLength()));
​​switch(ch)
​​{
​​case '+':d_op1=d_op1+d_op2;;break;
​​case '-':d_op1=d_op1-d_op2;;break;
​​case '*':d_op1=d_op1*d_op2;;break;​​
​​case '/':
​​​{
​​​​if(d_op2==0)
​​​​{
​​​​​dlg0.DoModal();
​​​​​return;
​​​​}
​​​​d_op1=d_op1/d_op2;
​​​}break;
​​case '^':d_op1=pow(d_op1,d_op2);break;
​​case '1':
​​​{
​​​​if(d_op2==0)
​​​​{
​​​​​dlg0.DoModal();
​​​​​return;
​​​​}
​​​​d_op1=pow(d_op1,1.0/d_op2);
​​​}break;
​​default:
​​​{
​​​​dlg0.DoModal();
​​​​return;
​​​}
​​}
​}
​str1[0].Format(_T("%.18f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';
​ di=0;//小数点个数置零
}
31.编写CDialog2::OnButtonExq()的处理函数
void CDialog2::OnButtonExp() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=exp(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
32.编写CDialog2::OnButtonInt()的处理函数
void CDialog2::OnButtonInt() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​double t=d_op1;
​int d_op1=int(t);
​str1[0].Format(_T("%d"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';
}
33.编写CDialog2::OnButtonLn()的处理函数
void CDialog2::OnButtonLn() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if(d_op1<=0)
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=log(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';
}
34.编写CDialog2::OnButtonLog()的处理函数
void CDialog2::OnButtonLog() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if(d_op1<=0)
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=log10(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
35.编写CDialog2::OnButtonM1()的处理函数
void CDialog2::OnButtonM1() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​SetDlgItemText(IDC_STATIC_MS," ");//在名为IDC_STATIC_MS的控件里显示字符串str
​ms=ms+d_op1;
​if(ms!=0)
​​SetDlgItemText(IDC_STATIC_MS,"m");//在名为IDC_STATIC_MS的控件里显示字符串str​
}
36.编写CDialog2::OnButtonM2()的处理函数
void CDialog2::OnButtonM2() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​SetDlgItemText(IDC_STATIC_MS," ");//在名为IDC_STATIC_MS的控件里显示字符串str
​ms=ms-d_op1;
​if(ms!=0)
​​SetDlgItemText(IDC_STATIC_MS,"m");//在名为IDC_STATIC_MS的控件里显示字符串str​
}
37.编写CDialog2::OnButtonMc()的处理函数
void CDialog2::OnButtonMc() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​ms=0;
​SetDlgItemText(IDC_STATIC_MS," ");//在名为IDC_STATIC_MS的控件里显示字符串str​
}
38.编写CDialog2::OnButtonMod()的处理函数
void CDialog2::OnButtonMod() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​double d1[20],d2=d_op1;
​double d_op1=modf(d2,d1);
​str1[0].Format(_T("%f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
39.编写CDialog2::OnButtonMr()的处理函数
void CDialog2::OnButtonMr() 
{
​// TODO: Add your control notification handler code here
​if(ms==0)
​{
​​dlg0.DoModal();
​​return;​
​}
​if(ch==' ')
​​str1[0]=str1[1]="";
​str1[1].Format(_T("%.12f"),ms);
​for(;str1[1].GetAt(str1[1].GetLength()-1)=='0';)
​​str1[1]=str1[1].Left(str1[1].GetLength()-1);
​if(str1[1].GetAt(str1[1].GetLength()-1)=='.')
​​str1[1]=str1[1].Left(str1[1].GetLength()-1);
​str1[0]=str1[0]+str1[1];
​ m_Edit.SetWindowText(str1[0]);
​di=1;//小数点个数置零
​SetDlgItemText(IDC_STATIC_MS,"m");//在名为IDC_STATIC_MS的控件里显示字符串str​
}
40.编写CDialog2::OnButtonMs()的处理函数
void CDialog2::OnButtonMs() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​ms=d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if(ms==0)
​{
​​dlg0.DoModal();
​​return;
​}
​SetDlgItemText(IDC_STATIC_MS,"m");//在名为IDC_STATIC_MS的控件里显示字符串str
}
41.编写CDialog2::OnButtonM1()的处理函数
void CDialog2::OnButtonMul() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​str1[1]="";
​str1[0].Insert(str1[0].GetLength(),'*');
​m_Edit.SetWindowText(str1[0]);
​ch='*';
​di=0;//小数点个数置零
}
42.编写CDialog2::OnButtonN()的处理函数
void CDialog2::OnButtonN() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if (d_op1!=int(d_op1))
​{
​​dlg0.DoModal();
​​return;
​}
​int i=fact(int(d_op1));
​str1[0].Format(_T("%d"),i);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
43.编写CDialog2::OnButtonPer()的处理函数
void CDialog2::OnButtonPer() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=d_op1*0.01;
​str1[0].Format(_T("%18f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
44.编写CDialog2::OnButtonPi()的处理函数
void CDialog2::OnButtonPi() 
{
​// TODO: Add your control notification handler code here
​if(str1[1]!=""&&str1[0]!="0")
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=pi;
​str1[1].Format(_T("%.12f"),d_op1);
​if(str1[0]=="0")
​​str1[0]="";
​str1[0]=str1[0]+str1[1];
​m_Edit.SetWindowText(str1[0]);​
}
45.编写CDialog2::OnButtonRe()的处理函数
void CDialog2::OnButtonRe() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if(d_op1==0)
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=1/d_op1;
​str1[0].Format(_T("%18f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
46.编写CDialog2::OnButtonSin()的处理函数
void CDialog2::OnButtonSin() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if(pBool==1)
​​d_op1=d_op1/180*pi;
​else if(pBool==3)
​​d_op1=d_op1/200*pi;
​d_op1=sin(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];​
}
47.编写CDialog2::OnButtonSinh()的处理函数
void CDialog2::OnButtonSinh() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=sinh(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​​
}
48.编写CDialog2::OnButtonSqroot()的处理函数
void CDialog2::OnButtonSqroot() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=sqrt(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';
}
49.编写CDialog2::OnButtonSu()的处理函数
void CDialog2::OnButtonSu() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​str1[1]="";
​str1[0].Insert(str1[0].GetLength(),'-');
​m_Edit.SetWindowText(str1[0]);
​ch='-';
​di=0;//小数点个数置零
}
50.编写CDialog2::OnButtonTan()的处理函数
void CDialog2::OnButtonTan() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​if(pBool==1)
​​d_op1=d_op1/180*pi;
​else if(pBool==3)
​​d_op1=d_op1/200*pi;
​if(d_op1==pi/2)
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=tan(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';
}
51.编写CDialog2::OnButtonTanh()的处理函数
void CDialog2::OnButtonTanh() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=tanh(d_op1);
​str1[0].Format(_T("%.12f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​​
}
52.编写CDialog2::OnButtonX2()的处理函数
void CDialog2::OnButtonX2() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=d_op1*d_op1;
​str1[0].Format(_T("%18f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
53.编写CDialog2::OnButtonX3()的处理函数
void CDialog2::OnButtonX3() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=d_op1*d_op1*d_op1;
​str1[0].Format(_T("%18f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​
}
54.编写CDialog2::OnButtonXy()的处理函数
void CDialog2::OnButtonXy() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​str1[1]="";
​str1[0].Insert(str1[0].GetLength(),'^');
​m_Edit.SetWindowText(str1[0]);
​ch='^';
​di=0;//小数点个数置零
}
55.编写CDialog2::OnButtonYx()的处理函数
void CDialog2::OnButtonYx() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​{
​​dlg0.DoModal();
​​return;
​}
​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​str1[1]="";
​str1[0]=str1[0]+" yroot";
​m_Edit.SetWindowText(str1[0]);
​ch='1';
​di=0;//小数点个数置零​
}
56.编写CDialog2::OnButtond()的处理函数
void CDialog2::OnButtond() 
{
​// TODO: Add your control notification handler code here
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.'||di) 
​{
​​dlg0.DoModal();
​​return;
​}
​if(str1[1]=="")
​{
​​str1[0]=str1[0].Insert(str1[0].GetLength(),'0');
​​str1[1]="0";
​}
​str1[1].Insert(str1[1].GetLength(),'.');
​str1[0].Insert(str1[0].GetLength(),'.');
​di=1;
​m_Edit.SetWindowText(str1[0]);
}
57.编写CDialog2::OnInitDialog()的处理函数
BOOL CDialog2::OnInitDialog() 
{
​CDialog::OnInitDialog();
​m_editFont.CreatePointFont(200, "宋体");
​m_Edit.SetFont(&m_editFont); // 设置新字体 
​// TODO: Add extra initialization here
​for(int i=0;i<2;i++)
​​str1[i]="0";
​d_op1=0,d_op2=0;
​ch=' ';
​CheckRadioButton(IDC_RADIO3,IDC_RADIO4,IDC_RADIO3);
​pBool=1;
​m_Edit.SetWindowText(str1[0]);
​SetDlgItemText(IDC_STATIC_MS," ");//在名为IDC_STATIC_MS的控件里显示字符串str
​CButton* popenbtn=(CButton*)GetDlgItem(IDCANCEL);
​popenbtn->SetFocus();//设置按钮焦点在返回主目录上
​return FALSE;  // return TRUE unless you set the focus to a control
​              // EXCEPTION: OCX Property Pages should return FALSE
}
58.编写CDialog2::OnButtonFa()的处理函数
void CDialog2::OnButtonFa() 
{
​// TODO: Add your control notification handler code here
​if(ch!=' ')
​​OnButtonEq();
​else
​​d_op1=atof(str1[1].GetBuffer(str1[1].GetLength()));
​d_op1=fabs(d_op1);
​str1[0].Format(_T("%18f"),d_op1);
​for(;str1[0].GetAt(str1[0].GetLength()-1)=='0';)
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​if(str1[0].GetAt(str1[0].GetLength()-1)=='.')
​​str1[0]=str1[0].Left(str1[0].GetLength()-1);
​ m_Edit.SetWindowText(str1[0]);
​ str1[1]=str1[0];
​ ch=' ';​​
}
59.编写CDialog2::OnRadio3()的处理函数
void CDialog2::OnRadio3() 
{
​// TODO: Add your control notification handler code here
​pBool=1;
}
60.编写CDialog2::OnRadio4()的处理函数
void CDialog2::OnRadio4() 
{
​// TODO: Add your control notification handler code here
​pBool=2;
}
61.编写CDialog2::OnRadio5()的处理函数
void CDialog2::OnRadio5() 
{
​// TODO: Add your control notification handler code here
​pBool=3;
}
62.编写CDialog2::OnCtlColor()的处理函数
HBRUSH CDialog2::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
​HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
​// TODO: Change any attributes of the DC here
​if(pWnd->GetDlgCtrlID() ==IDC_EDIT1)
​​pDC->SetTextColor(RGB(255,0,100));//用RGB宏改变颜色设置字体颜色 
​// TODO: Return a different brush if the default is not desired
​return hbr;
}
63.编写CDialog2::OnCancel() 的处理函数
void CDialog2::OnCancel() 
{
​// TODO: Add extra cleanup here
​CDialog::OnCancel();
​CCWindowsDazuoyeDlg dlg;
​dlg.DoModal();
}
64.编写CDialog2::OnCancel() 的处理函数
void CDialog2::OnButton() 
{
​// TODO: Add your control notification handler code here
​CDialog4 dlg;
​dlg.DoModal();​
}

65.编写计算n!的函数

项目切换到工作区间,选择头文件中“CDialog2.h”,在下列位置添加如下代码(红色为新加代码):

double CDialog2::d_op1,CDialog2::d_op2;//数值

char CDialog2::ch=' ';//运算符初始化

int fact(int n)//求n的阶乘

{

​int sum;

​if (n==1)

​​return 1;

​else

​{

​​sum=n*fact(n-1);

​​return sum;

​}

}

CDialog2::CDialog2(CWnd* pParent /*=NULL*/)

​: CDialog(CDialog2::IDD, pParent)

{

66.添加头文件

要想返回主目录、调用出错信息对话框、调用作者信息对话框和使用数学库函数,需增加头文件;项目切换到工作区间,选择头文件中“CDialog2.cpp”,在下列位置添加如下代码(红色为新加代码)初始化静态成员变量:

#include "stdafx.h"
#include "CWindowsDazuoye.h"
#include "Dialog2.h"
#include"MyDialog0.h"
#include"CWindowsDazuoyeDlg.h"
#include "Dialog4.h"
#include<stdio.h>
#include<math.h>
#ifdef _DEBUG
#define new DEBUG_NEW
六.设计日期和天数计算

1.创建对话框CDialog3

(仿照 三.1.创建对话框CMyDialog1步骤)并右击对话框修改其标题为“windows程序设计第二组--计算器”

2.设计CDialog3

并按要求和表9、图 23所示内容,向对话框模板中加入控件。(参照 三.2设计CMyDialog1的步骤)

图 23

表9 控件属性

控件类型

ID

标题

其他属性

静态文本

默认

日期1:

默认

静态文本

默认

日期2:

默认

日期时间选取控件

IDC_DATETIMEPICKER1

在样式中格式下拉框中选择长日期,选定允许编辑

日期时间选取控件

IDC_DATETIMEPICKER2

在样式中格式下拉框中选择长日期,选定允许编辑

分组框

默认

计算两个日期之差

默认

静态文本

IDC_STATIC_DATE

0

在样式中的排列文本下拉框中选定居中,并选中垂直居中,凹陷和边框属性

命令按钮

IDC_BUTTON_CACL1

计算

默认

分组框

默认

日期1加上或减去天数

默认

编辑框

IDC_EDIT1

在样式中的排列文本下拉框中选定居中,选定数字

单选按钮

IDC_RADIO1

加上+

默认

单选按钮

IDC_RADIO2

减去-

默认

命令按钮

IDC_BUTTON_CACL2

计算

默认

命令按钮

IDOK

结束程序

默认

命令按钮

IDC_BUTTON2

作者信息

默认

命令按钮

IDCANCEL

返回主目录

默认

3.关联变量

(仿照三. 3.关联变量步骤)建立新类“CDialog3”并按“表 10CDialog3类的控件关联变量”关联变量

(其中关联IDC_EDIT1的成员变量时,设置取值范围(0~450000),因为过大会导致系统崩溃,如图 24所示)

表 10 CDialog3类的控件关联变量

控件ID

变量类型

变量名

IDC_DATETIMEPICKER1

CDateTimeCtr

m_CtrlTime1

IDC_DATETIMEPICKER2

​CDateTimeCtr

m_CtrlTime1

IDC_EDIT1

int

m_Edit

图 24

4.添加成员变量

(仿照三. 4.添加成员变量步骤)

表 11  CDialog3类成员变量

变量类型

变量名称

访问权限

BOOL

m_pBool

Protected

或者项目切换到工作区间,选择头文件中“CDialog3.h”z在下列位置添加如下代码(红色为新加代码):

​afx_msg void OnButton2();

​//}}AFX_MSG

​DECLARE_MESSAGE_MAP()

protected:

​BOOL p_Bool;

};

//{{AFX_INSERT_LOCATION}}

5.添加消息处理函数

(仿照三. 6.添加消息处理函数)按表 12  CDialog3的控件通知消息处理函数添加消息处理函数

表  12  CDialog3的控件通知消息处理函数

控件ID

消息

消息处理函数

IDC_BUTTON_CACL1

BN_CLICKED

默认

IDC_RADIO1

BN_CLICKED

默认

IDC_RADIO2

BN_CLICKED

默认

IDC_BUTTON_CACL2

BN_CLICKED

默认

IDOK

BN_CLICKED

默认

IDC_BUTTON2

BN_CLICKED

默认

IDCANCEL

BN_CLICKED

默认

CDialog3

WM_INITDIALOG

默认

6. 编写CDialog3::OnButtonCacl1()消息处理函数:
void CDialog3::OnButtonCacl1() 
{
​// TODO: Add your control notification handler code here
​CTime time1,time2;
​m_CtrlTime1.GetTime(time1);
​m_CtrlTime2.GetTime(time2);
​int mon_day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
​int count=0;
​int r_month=time1.GetMonth(),r_day=time1.GetDay(),r_year=time1.GetYear();//中间替换变量t_year,t_mont,,t_day,防止日期改变
​int t_month=time2.GetMonth(),t_day=time2.GetDay(),t_year=time2.GetYear();//中间替换变量t_year,t_mont,,t_day,防止日期改变
​int day=t_day,month=t_month,year=t_year;
​if(year>r_year||(year==r_year&&month>r_month||(year==r_year&&month==r_month&&day>r_day)))  //若日期在系统日期后面,交换日期
​{
​​day=r_day;
​​month=r_month;
​​year=r_year;
​​r_day=t_day;
​​r_month=t_month;
​​r_year=t_year;
​}
​t_month=month,t_day=day,t_year=year;   //重新给中间变量赋值
​if(t_year<r_year-1)
​{
​​if(t_month<=2&&(t_year%4==0&&t_year%100!=0||t_year%400==0)) 
​​​count+=366;
​​else
​​​count+=365;
​}
​for(t_year=t_year++;t_year<r_year-1;t_year++)  //计算整年的天数,修改整年天数
​{
​​if(t_year%4==0&&t_year%100!=0||t_year%400==0)  
​​​count+=366;
​​else
​​​count+=365;
​}
​if(t_year==r_year-1)
​{
​​if(t_year%4==0&&t_year%100!=0||t_year%400==0)  //判断年份是否为闰年,修改2月份天数
​​​mon_day[1]=29;
​​else
​​​mon_day[1]=28;
​​for(t_month=month;t_month<=12;t_month++)
​​​count+=mon_day[t_month-1];
​​t_year++;
​​if(t_year%4==0&&t_year%100!=0||t_year%400==0)   //再次判断年份是否为闰年,再次修改2月份天数
​​​mon_day[1]=29;
​​else
​​​mon_day[1]=28;
​​if(t_day>r_day)               //比较两日期的天数
​​{
​​​t_month=1;
​​​if(r_month!=1)
​​​{
​​​​for(t_month=1;t_month<r_month-1;t_month++)
​​​​​count+=mon_day[t_month-1];
​​​​for(t_day=day;t_day<mon_day[t_month-1]+r_day;t_day++,count++);
​​​}
​​​else
​​​{
​​​​for(t_day=day;t_day<r_day;t_day,count++) ;
​​​​count=count-day+1;
​​​}
​​}
​​else
​​{
​​​t_month=1;
​​​if(r_month!=1)
​​​{
​​​for(t_month=1;t_month<r_month;t_month++)
​​​​count+=mon_day[t_month-1];
​​​for(t_day=day;t_day<r_day;t_day++,count++);
​​​}
​​​else
​​​{
​​​​for(t_day=day;t_day<r_day;t_day,count++) ;
​​​​count=count-day+1;
​​​}
​​}
​}
​else
​{
​​if(t_year%4==0&&t_year%100!=0||t_year%400==0)   //判断年份是否为闰年,修改2月份天数
​​​mon_day[1]=29;
​​else
​​​mon_day[1]=28;
​​if(t_day>r_day)
​​{
​​​for(t_month=month;t_month<r_month-1;t_month++)
​​​​count+=mon_day[t_month-1];
​​​for(t_day=day;t_day<mon_day[t_month-1]+r_day;t_day++,count++);
​​}
​​else
​​{
​​​for(t_month=month;t_month<r_month;t_month++)
​​​​count+=mon_day[t_month-1];
​​​for(t_day=day;t_day<r_day;t_day++,count++);
​​}
​}
​CString s;
​s.Format("%d",count);
​SetDlgItemText(IDC_STATIC_DATE,s);//在名为IDC_STATIC_DATE的控件里显示字符串str
}
7. 编写CDialog3::OnButtonCacl2()消息处理函数:
void CDialog3::OnButtonCacl2() 
{
​// TODO: Add your control notification handler code here
​UpdateData(true);
​CTime time1,time2;
​m_CtrlTime1.GetTime(time1);
​m_CtrlTime2.GetTime(time2);
​int mon_day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
​int r_month=time1.GetMonth(),r_day=time1.GetDay(),r_year=time1.GetYear();//得到日期控件1的日期
​if(p_Bool)
​{
​​for(int i=0;i<m_Edit;i++)
​​{
​​​if(r_year%4==0&&r_year%100!=0||r_year%400==0)   //判断年份是否为闰年,修改2月份天数
​​​​mon_day[1]=29;
​​​else
​​​​mon_day[1]=28;
​​​r_day++;
​​​if(r_day>mon_day[r_month-1])
​​​{
​​​​r_day=1;
​​    ​r_month++;
​​​​if(r_month>12)
​​​​{
​​​​​r_month=1;
​​​​​r_year++;
​​​​}
​​​}
​​}
​}
​else
​{
​​for(int i=0;i<m_Edit;i++)
​​{
​​​r_day--;
​​​if(r_day<1)
​​​{
​​    ​r_month--;
​​​​if(r_month<1)
​​​​{
​​​​​r_month=12;
​​​​​r_year--;
​​​​}
​​​​if(r_year%4==0&&r_year%100!=0||r_year%400==0)   //判断年份是否为闰年,修改2月份天数
​​​​​mon_day[1]=29;
​​​​else
​​​​​mon_day[1]=28;
​​​​r_day=mon_day[r_month-1];
​​​}
​​}
​}
​CDateTimeCtrl* pCtrl = (CDateTimeCtrl*)GetDlgItem(IDC_DATETIMEPICKER2);//设置控件2的日期
​SYSTEMTIME sysTime;   
​memset(&sysTime,0,sizeof(sysTime));   
​sysTime.wYear =r_year;   
​sysTime.wMonth = r_month;   
​sysTime.wDay = r_day;   
​VERIFY(pCtrl->SetTime(&sysTime));
}
8. 编写CDialog3::OnRadio1()消息处理函数:
void CDialog3::OnRadio1() 
{
​// TODO: Add your control notification handler code here
​p_Bool=true;
}
9. 编写CDialog3::OnRadio2()消息处理函数:
void CDialog3::OnRadio2() 
{
​// TODO: Add your control notification handler code here
​p_Bool=false;
}
10. 编写CDialog3::OnInitDialog() 消息处理函数:
BOOL CDialog3::OnInitDialog() 
{
​CDialog::OnInitDialog();
​// TODO: Add extra initialization here
​p_Bool=true;
​CheckRadioButton(IDC_RADIO1,IDC_RADIO2,IDC_RADIO1);
​CButton* popenbtn=(CButton*)GetDlgItem(IDCANCEL);
​popenbtn->SetFocus();//设置按钮焦点在返回主目录上
​return FALSE;  // return TRUE unless you set the focus to a control
​              // EXCEPTION: OCX Property Pages should return FALSE
}
11. 编写CDialog3::OnCancel() 消息处理函数:
void CDialog3::OnCancel() 
{
​// TODO: Add extra cleanup here
​CDialog::OnCancel();
​CCWindowsDazuoyeDlg dlg;
​dlg.DoModal();
}
12. 编写CDialog3::OnButton2() 消息处理函数:
void CDialog3::OnButton2() 
{
​// TODO: Add your control notification handler code here
​CDialog4 dlg;
​dlg.DoModal();​
}
13.添加头文件

要想返回主目录和调用作者信息对话框,需增加头文件;项目切换到工作区间,选择头文件中“CDialog3.cpp”,在下列位置添加如下代码(红色为新加代码):

#include "stdafx.h"

#include "CWindowsDazuoye.h"

#include "Dialog3.h"

#include "CWindowsDazuoyeDlg.h"

#include "Dialog4.h"

#ifdef _DEBUG

#define new DEBUG_NEW

七.设计作者信息

1.创建对话框CDialog4

(仿照 三.1.创建对话框CMyDialog1步骤)并右击对话框修改其标题为“windows程序设计第二组---作者信息”并设置字体大小和字体类型(如图 25所示)

图 25

2.设计CDialog4

并按要求和表13、图 26所示内容,向对话框模板中加入控件。(参照 三.2设计CMyDialog1的步骤)

图 26

表13 控件属性

控件类型

ID

标题

其它属性

静态图片

默认

静态文本

默认

windows课程设计大作业

默认

分组框

默认

静态文本

默认

所属学院:  计  算  机  学  院\n所属专业:    软  件   工  程 \n所属班级:    软  件 113  班\n指导老师:      *   *   *\n课程名称:windows程序设计\n所属小组: 软件113班第二组

默认

静态文本

默认

***********\n***********\n***********

默认

命令按钮

IDCANCEL

结束程序

默认

命令按钮

IDOK

返回

默认

3. 添加消息处理函数

(仿照三. 3.关联变量步骤)建立新类“CDialog4”并添加IDCANCEL的消息处理函数

4. 编写CDialog4:::OnCancel() 消息处理函数:
void CDialog4::OnCancel() 
{
​// TODO: Add extra cleanup here
​​exit(0);
​CDialog::OnCancel();
}
八.设计调用(主目录)
1. 设置字体和标题

(仿照 七.1.创建对话框CDialog1步骤)并右击对话框修改其标题为“windows程序设计第二组--主目录”并设置与之相同类型的字体大小和字体类型

2.设计IDD_CWINDOWSDAZUOYE_DIALOG对话框

删除该模板上除确定按钮以外的控件。并按要求和表14、图27所示内容,向对话框模板中加入控件(参照 三.2设计CMyDialog1的步骤)

图 27

表 14 控件属性

控件类型

ID

标题

其他属性

分组框

默认

作者简略信息

默认

静态文本

默认

***********\n***********\n***********

默认

命令按钮

IDC_BUTTON1

钟表和电子钟

默认

命令按钮

IDC_BUTTON_CACL

计算器

默认

命令按钮

IDC_BUTTON2

日期和天数计算

默认

命令按钮

IDC_BUTTON3

作者信息

默认

命令按钮

IDOK

结束程序

默认

3.添加消息处理函数

(仿照三. 3.关联变量步骤)按表 15 CCWindowsDazuoyeDlg的控件通知消息处理函数添加消息处理函数

表 15 CCWindowsDazuoyeDlg的控件通知消息处理函数

控件ID

消息

消息处理函数

IDC_BUTTON1

BN_CLICKED

默认

IDC_BUTTON_CACL

BN_CLICKED

默认

IDC_BUTTON2

BN_CLICKED

默认

IDC_BUTTON3

BN_CLICKED

默认

4. 编写CCWindowsDazuoyeDlg::OnButton1() 消息处理函数:
void CCWindowsDazuoyeDlg::OnButton1() 
{
​// TODO: Add your control notification handler code here
​OnOK();
​CMyDialog1 dlg;
​dlg.DoModal();
}
5. 编写CCWindowsDazuoyeDlg::OnButtonCacl() 消息处理函数:
void CCWindowsDazuoyeDlg::OnButtonCacl() 
{
​// TODO: Add your control notification handler code here
​OnOK();
​CDialog2 dig;
​dig.DoModal();
}
6. 编写CCWindowsDazuoyeDlg::OnButton2() 消息处理函数:
void CCWindowsDazuoyeDlg::OnButton2() 
{
​// TODO: Add your control notification handler code here
​OnOK();
​CDialog3 dig;
​dig.DoModal();
}
7. 编写CCWindowsDazuoyeDlg::OnButton3() 消息处理函数:
void CCWindowsDazuoyeDlg::OnButton3() 
{
​// TODO: Add your control notification handler code here
​​CMyDialog1 dig;
​dig.DoModal();
}
8.添加头文件

项目切换到工作区间,选择头文件中“CWindowsDazuoyeDlg.cpp”,在在下列位置添加如下代码(红色为新加代码):

// CWindowsDazuoyeDlg.cpp : implementation file

//

#include "stdafx.h"

#include "CWindowsDazuoye.h"

#include "CWindowsDazuoyeDlg.h"

#include"MyDialog1.h"

#include"Dialog2.h"

#include "CWindowsDazuoye.h"

#include "Dialog3.h"

#include "Dialog4.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

九.运行程序(部分截图)

运行结果如图 28-图30所示

图 28

图 29

图 30

十.程序调试及修改

1.在最终编译执行时,有一些错误,不能执行程序,在小组各人员的努力下终于找到了原因。

2.在本次程序编写中,运到的最大的困难:钟表的绘画,试了许多办法,终于在小组的讨论中,突发奇想,直接在对话框中绘图,不使用任何控件,结果证明想法正确。然后是图片的闪烁问题,经过本小组讨论和网上的方法,最终使用的双缓冲区,但是还是有部分会闪烁,使用局部更新,一些控件得不到显示,这也是本次程序的一些遗憾

3.在运行中,本程序还出过了其它的一些小错误,不过,经过本小组的精心调试,终于可以正确运行了.

十一.总结

通过本题大作业,让我们小组更加熟悉了mfc的创建和使用方法及技巧,知道了各自的不足,相信我们今后将会更加熟练的运用通mfc。由于本小组人员有限,知识能力有限,时间有限,这次windows大作业,最后并没能达到所预期的效果,如:钟表和电子钟显示时有些控件回来回闪动(虽然表盘不动)计划着写一个科学计算器(能计算表达式),但由于种种原因,并没能写成,深感遗憾!虽然没能及时的完整做完这次实验,但通过本次试验计培养了我们对这些实际问题的分析能力、解决一些实际问题的能力和团队合作能力。通过编程,巩固了我们对编程思想和写程序的能力。

12. 致谢
    在学习windows程序设计这门课中,陆老师严谨的治学态度、丰富渊博的知识、敏锐的学术思维、精益求精的工作态度以及侮人不倦的师者风范是我们小组终生学习的楷模,陆老师的高深精湛的造诣与严谨求实的治学精神,将永远激励着我们小组的每一个成员。这一年多得时间中还得到众多老师的关心支持和帮助。在此,谨向老师们致以衷心的感谢和崇高的敬意!
   最后,我要向百忙之中抽时间对本次作业进行审阅,评议和参与本小组论文答辩的陆老师表示感谢!
  
                                    2012年12月3日

Windows程序设计第二组

转载于:https://www.cnblogs.com/liudongyan/p/4158454.html

MFC 时钟 计算器 日期天数计算相关推荐

  1. 预产期计算器在线计算生男生女计算机,预产期计算器生男生女在线查询-预产期计算器及天数计算时间软件2017版-腾牛安卓网...

    预产期计算器及天数计算时间软件是一款算十月怀胎准确天数的软件.这是2017年的最新计算软件,小编在这里还提供清宫图哦,需要的用户快来下载看一看,生男生女自己决定. 预产期计算器及天数计算: 预产期,即 ...

  2. javascript_day03------js学习第三天,关于简易计算器的加减乘除,对于年份判断和日期天数计算,以及if和switch的区分用法,最后是循环。

    js的学习很重要,基础知识点要落实.这既离不开日常的练习使用锻炼自己的计算机思维模式,同样的知识点分析总结和整理也是重中之重,不能只懂怎么用却不能明白自己这样使用的原理和方法. 1.简易计算器 1.先 ...

  3. 资产监测设备使用时,设置具体指定日期天数计算

    近期笔者在进行资产监测设备,该设备主要是通过技术实现远程对资产的状态进行获取,比如远程对资产的位置进行实时获取,或者定时获取资产所处环境的温湿度.运动情况等. 有些资产监测设备单片机RTC采用的是BC ...

  4. 关于日期天数计算的函数(转)

    今天早上突然要用到一个计算某月有多少天的函数,翻了半天没找到系统自带着中函数,于是动手写了一个,如下: **返回某个月有多少天 FUNCTION HowMonthDay() PARAMETERS cD ...

  5. 如何用计算机算时间,在win10电脑的计算器中如何进行日期的计算

    在win10电脑的计算器中如何进行日期的计算 今天给大家介绍一下在win10电脑的计算器中如何进行日期的计算的具体操作步骤. 1. 首先打开电脑,找到自带的计算器,打开进入. 2. 在打开的计算器页面 ...

  6. localdate计算相差天数_还在苦恼MySQL如何根据日期精确计算年龄?看这一篇,就够了

    转译自 How To Calculate Age From Date Of Birth In MySQL- Querychat. 中文转载,请注明出处. 使用SQL语句计算年龄,在事务处理和日期计算中 ...

  7. java日期的计算(当月剩余天数、获取日期当月的天数)

    日常开发中会遇到关于日期的计算比如:当月的天数.两日期之间的天数.当月剩余天数等等...... 下方为关于日期计算的demo,后期会持续更新... 获取日期当月的天数或某月总天数 /*** 获取日期当 ...

  8. js 日期 加天数计算

    js 日期 加天数计算 AddDate=(date, days)=> {//日期计算if (!days) {days = 1;}var date = new Date(date);date.se ...

  9. js 日期增加加天数计算

    //日期加天数计算 date:时间戳, days:天数 默认1天 function AddDate(date, days) {if (!days) {days = 1;}var date = new ...

最新文章

  1. [Python人工智能] 二十三.基于机器学习和TFIDF的情感分类(含详细的NLP数据清洗)
  2. 关于glusterfs-3.0.4中AFR修复的一个bug
  3. ubuntu python3.7修改默认pip版本_Ubuntu16.04安装Python3.7及其pip3并切换为默认版本
  4. 在小程序端获取数据库所有符合条件的数据(使用分页突破20条限制)
  5. 数字游戏---巧妙解答
  6. spring boot组件_Spring Boot Framework的关键组件和内部
  7. android sqlitelog,如何解决Sqlitelog(13)语句中止在PhoneGap中的68错误android
  8. GAN生成式对抗网络简介及MINST实现
  9. 这些年,我身边的那些人和事
  10. maven clean Process terminated
  11. iPhone启动页尺寸
  12. 产品运动动画用什么软件做的_3C产品渲染用什么软件好?Keyshot,工业设计必备!...
  13. 专访黄泽武:顺丰科技是如何应用边缘计算的?
  14. python幂次方计算公式_【python】计算一个数得n次方?
  15. matlab 沃尔什矩阵,压缩感知——沃尔什-哈达玛(WHT)变换与逆变换的Matlab代码实现...
  16. [pyspark]itemcf协同过滤推荐算法------应用华为比赛数据实现(包含转化为稀疏向量,lsh模型,杰卡德距离)
  17. 框架成为新的编程语言的7种理由
  18. PAT乙级 1070 结绳
  19. lamp mysql什么意思_什么是lampapache+mysql+php
  20. macbook pro下安装三系统

热门文章

  1. oracle 用户被锁住 28000 the account is locked
  2. 《少有人走的路》语录
  3. Unity屏幕永远保持为固定分辨率
  4. 灵性图书馆:好书推荐-《荷欧波诺波诺的幸福奇迹》
  5. 我本可以忍受黑暗,如果我不曾见过太阳。
  6. python爬虫英文单词_非常适合新手的一个Python爬虫项目:打造一个英文词汇量测试脚本...
  7. jQuery教程(整理自W3CSchool)(第一部分)
  8. python操作键盘和鼠标_1、[python] PyMouse、PyKeyboard用python操作鼠标和键盘
  9. VLC保存网络视频及抓包合成视频
  10. 漫威系列-《复联4》