vc60中用MFC编写计算器代码文档格式.docx

上传人:b****3 文档编号:14842081 上传时间:2022-10-25 格式:DOCX 页数:17 大小:18.27KB
下载 相关 举报
vc60中用MFC编写计算器代码文档格式.docx_第1页
第1页 / 共17页
vc60中用MFC编写计算器代码文档格式.docx_第2页
第2页 / 共17页
vc60中用MFC编写计算器代码文档格式.docx_第3页
第3页 / 共17页
vc60中用MFC编写计算器代码文档格式.docx_第4页
第4页 / 共17页
vc60中用MFC编写计算器代码文档格式.docx_第5页
第5页 / 共17页
点击查看更多>>
下载资源
资源描述

vc60中用MFC编写计算器代码文档格式.docx

《vc60中用MFC编写计算器代码文档格式.docx》由会员分享,可在线阅读,更多相关《vc60中用MFC编写计算器代码文档格式.docx(17页珍藏版)》请在冰豆网上搜索。

vc60中用MFC编写计算器代码文档格式.docx

//存储一次运算的第二个操作数

//CStringm_operator;

//存储运算符

//doublem_coff;

//存储小数点的系数权值

/////////////////////////////////////////////////////////////////////////////

//CAboutDlgdialogusedforAppAbout

classCAboutDlg:

publicCDialog

{

public:

CAboutDlg();

//DialogData

//{{AFX_DATA(CAboutDlg)

enum{IDD=IDD_ABOUTBOX};

//}}AFX_DATA

//ClassWizardgeneratedvirtualfunctionoverrides

//{{AFX_VIRTUAL(CAboutDlg)

protected:

virtualvoidDoDataExchange(CDataExchange*pDX);

//DDX/DDVsupport

//}}AFX_VIRTUAL

//Implementation

protected:

//{{AFX_MSG(CAboutDlg)

//}}AFX_MSG

DECLARE_MESSAGE_MAP()

};

CAboutDlg:

:

CAboutDlg():

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_MAP

END_MESSAGE_MAP()

//CCKcalculateDlgdialog

CCKcalculateDlg:

CCKcalculateDlg(CWnd*pParent/*=NULL*/)

:

CDialog(CCKcalculateDlg:

IDD,pParent)

//voidUpdateDisplay(double);

//voidCalculate(void);

//{{AFX_DATA_INIT(CCKcalculateDlg)

///////////////////////////////////////////////////////////////////////////////////////////////////

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"

//NotethatLoadIcondoesnotrequireasubsequentDestroyIconinWin32

m_hIcon=AfxGetApp()->

LoadIcon(IDR_MAINFRAME);

voidCCKcalculateDlg:

//{{AFX_DATA_MAP(CCKcalculateDlg)

DDX_Text(pDX,IDC_DISPLAY,m_display);

//}}AFX_DATA_MAP

BEGIN_MESSAGE_MAP(CCKcalculateDlg,CDialog)

//{{AFX_MSG_MAP(CCKcalculateDlg)

ON_WM_SYSCOMMAND()

ON_WM_PAINT()

ON_WM_QUERYDRAGICON()

ON_BN_CLICKED(IDC_BUTTON0,OnButton0)

ON_BN_CLICKED(IDC_BUTTON1,OnButton1)

ON_BN_CLICKED(IDC_BUTTON2,OnButton2)

ON_BN_CLICKED(IDC_BUTTON3,OnButton3)

ON_BN_CLICKED(IDC_BUTTON4,OnButton4)

ON_BN_CLICKED(IDC_BUTTON5,OnButton5)

ON_BN_CLICKED(IDC_BUTTON6,OnButton6)

ON_BN_CLICKED(IDC_BUTTON7,OnButton7)

ON_BN_CLICKED(IDC_BUTTON8,OnButton8)

ON_BN_CLICKED(IDC_BUTTON9,OnButton9)

ON_BN_CLICKED(IDC_BUTTON_ADD,OnButtonAdd)

ON_BN_CLICKED(IDC_BUTTON_MINUS,OnButtonMinus)

ON_BN_CLICKED(IDC_BUTTON_MUTIPLY,OnButtonMutiply)

ON_BN_CLICKED(IDC_BUTTON_DIV,OnButtonDiv)

ON_BN_CLICKED(IDC_BUTTON_SIGH,OnButtonSigh)

ON_BN_CLICKED(IDC_BUTTON_POINT,OnButtonPoint)

ON_BN_CLICKED(IDC_BUTTON_CLEAR,OnButtonClear)

ON_BN_CLICKED(IDC_BUTTON_SQRT,OnButtonSqrt)

ON_BN_CLICKED(IDC_BUTTON_RECI,OnButtonReci)

ON_BN_CLICKED(IDC_BUTTON_EQUAL,OnButtonEqual)

ON_BN_CLICKED(IDC_BUTTON_SIN,OnButtonSin)

ON_BN_CLICKED(IDC_BUTTON_COS,OnButtonCos)

ON_BN_CLICKED(IDC_BUTTON_LOG,OnButtonLog)

ON_BN_CLICKED(IDC_BUTTON_XDEY,OnButtonXdeY)

//CCKcalculateDlgmessagehandlers

BOOLCCKcalculateDlg:

OnInitDialog()

OnInitDialog();

//Add"

About..."

menuitemtosystemmenu.

//IDM_ABOUTBOXmustbeinthesystemcommandrange.

ASSERT((IDM_ABOUTBOX&

0xFFF0)==IDM_ABOUTBOX);

ASSERT(IDM_ABOUTBOX<

0xF000);

CMenu*pSysMenu=GetSystemMenu(FALSE);

if(pSysMenu!

=NULL)

{

CStringstrAboutMenu;

strAboutMenu.LoadString(IDS_ABOUTBOX);

if(!

strAboutMenu.IsEmpty())

{

pSysMenu->

AppendMenu(MF_SEPARATOR);

AppendMenu(MF_STRING,IDM_ABOUTBOX,strAboutMenu);

}

}

//Settheiconforthisdialog.Theframeworkdoesthisautomatically

//whentheapplication'

smainwindowisnota

SetIcon(m_hIcon,TRUE);

//Setbigicon

SetIcon(m_hIcon,FALSE);

//Setsmallicon

//TODO:

Addextrainitializationhere

returnTRUE;

//returnTRUEunlessyousetthefocustoacontrol

OnSysCommand(UINTnID,LPARAMlParam)

if((nID&

0xFFF0)==IDM_ABOUTBOX)

CAboutDlgdlgAbout;

dlgAbout.DoModal();

else

CDialog:

OnSysCommand(nID,lParam);

//Ifyouaddaminimizebuttontoyourdialog,youwillneedthecodebelow

//todrawtheicon.ForMFCapplicationsusingthedocument/viewmodel,

//thisisau

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > PPT模板 > 商务科技

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1