vc6.0用mfc编写的计算器代码.doc
文本预览下载声明
// CKcalculateDlg.cpp : implementation file
//
#include stdafx.h
#include math.h
#include CKcalculate.h
#include CKcalculateDlg.h
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// double m_first; //存储一次运算的第一个操作数及一次运算的结果
// double m_second; //存储一次运算的第二个操作数
// CString m_operator; //存储运算符
// double m_coff; //存储小数点的系数权值
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
/////////////////////////////////////////////////////////////////////////////
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
// DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCKcalculateDlg dialog
CCKcalculateDlg::CCKcalculateDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCKcalculateDlg::IDD, pParent)
{
// void UpdateDisplay(double);
// void Calculate(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);
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()-L
显示全部