【vc++精品源码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。
网学会员整理了vc++精品源码-MFC计算器主要代码(C++) - 其它资料的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
// Calculator_17483Dlg.cpp : implementation file//includequotstdafx.hquotincludequotCalculator_17483.hquotincludequotCalculator_17483Dlg.hquotincludequotafxdialogex.hquotifdef _DEBUGdefinenewD
EBUG_NEWendif// CAboutDlg dialog used for App AboutclassCAboutDlg : publicCDialogExpublic: CAboutDlg// Dialog Data enum IDD IDD_ABOUTBOX protected: virtualvoidDoDataExchangeCDataExchange pDX //DDX/DDV support// Implementationprotected: DECLARE_MESSAGE_MAPCAboutDlg::CAboutDlg : CDialogExCAboutDlg::IDDvoidCAboutDlg::DoDataExchangeCDataExchange pDX CDialogEx::DoDataExchangepDXBEGIN_MESSAGE_MAPCAboutDlg CDialogExEND_MESSAGE_MAP// CCalculator_17483Dlg dialogCCalculator_17483Dlg::CCalculator_17483DlgCWndpParent/NULL/ : CDialogExCCalculator_17483Dlg::IDD pParent num10 num20 operation0 point0 nump_10 nump_20 m_hIcon AfxGetApp-gtLoadIconIDR_MAINFRAMEvoidCCalculator_17483Dlg::DoDataExchangeCDataExchange pDX CDia
logEx::DoDataExchangepDXBEGIN_MESSAGE_MAPCCalculator_17483Dlg CDialogEx ON_WM_SYS
COMMAND ON_WM_PAINT ON_WM_QUERYDRAGICON ON_BN_CLICKEDIDC_BUTTON1ampCCalculator_17483Dlg::OnBnClickedButton1 ON_BN_CLICKEDIDC_BUTTON2ampCCalculator_17483Dlg::OnBnClickedButton2 ON_BN_CLICKEDIDC_BUTTON3ampCCalculator_17483Dlg::OnBnClickedButton3 ON_BN_CLICKEDIDC_BUTTON4ampCCalculator_17483Dlg::OnBnClickedButton4 ON_BN_CLICKEDIDC_BUTTON5ampCCalculator_17483Dlg::OnBnClickedButton5 ON_BN_CLICKEDIDC_BUTTON6ampCCalculator_17483Dlg::OnBnClickedButton6 ON_BN_CLICKEDIDC_BUTTON7ampCCalculator_17483Dlg::OnBnClickedButton7 ON_BN_CLICKEDIDC_BUTTON8ampCCalculator_17483Dlg::OnBnClickedButton8 ON_BN_CLICKEDIDC_BUTTON9ampCCalculator_17483Dlg::OnBnClickedButton9 ON_BN_CLICKEDIDC_BUTTON10ampCCalculator_17483Dlg::OnBnClickedButton10 ON_BN_CLICKEDIDC_BUTTON11ampCCalculator_17483Dlg::OnBnClickedButton11 ON_BN_CLICKEDIDC_BUTTON12ampCCalculator_17483Dlg::OnBnClickedButton12 ON_BN_CLICKEDIDC_BUTTON13ampCCalculator_17483Dlg::OnBnClickedButton13 ON_BN_CLICKEDIDC_BUTTON14ampCCalculator_17483Dlg::OnBnClickedButton14 ON_BN_CLICKEDIDC_BUTTON15ampCCalculator_17483Dlg::OnBnClickedButton15 ON_BN_CLICKEDIDC_BUTTON16ampCCalculator_17483Dlg::OnBnClickedButton16 ON_BN_CLICKEDIDC_BUTTON17ampCCalculator_17483Dlg::OnBnClickedButton17END_MESSAGE_MAP// CCalculator_17483Dlg message handlersBOOLCCalculator_17483Dlg::OnInitDialog CDialogEx::OnInitDialog // Add quotAbout...quot menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERTIDM_ABOUTBOXamp 0xFFF0 IDM_ABOUTBOX ASSERTIDM_ABOUTBOXlt 0xF000 CMenu pSysMenu GetSystemMenuFALSE if pSysMenu NULL BOOLbNameValid
CStringstrAboutMenu bNameValid strAboutMenu.LoadStringIDS_ABOUTBOX ASSERTbNameValid if strAboutMenu.IsEmpty pSysMenu-gt
AppendMenuMF_SEPARATOR pSysMenu-gtAppendMenuMF_STRING IDM_ABOUTBOXstrAboutMenu // Set the icon for this dialog. The framework does thisautomatically // when the applications main window is not a dialog SetIconm_hIcon TRUE // Set big icon SetIconm_hIcon FALSE // Set small icon // TODO: Add extra initialization here returnTRUE // return TRUE unless you set the focus to acontrolvoidCCalculator