1、#include stdafx.hmfccalc.hcalcdlg.h#ifdef _DEBUG#undef THIS_FILEstatic char BASED_CODE THIS_FILE = _FILE_;#endif/ CAboutDlg dialog used for App Aboutclass CAboutDlg : public CDialogpublic: CAboutDlg();/ Dialog Data /AFX_DATA(CAboutDlg) enum IDD = IDD_ABOUTBOX ; /AFX_DATA/ Implementationprotected: vi
2、rtual void DoDataExchange(CDataExchange* pDX);/ DDX/DDV support /AFX_MSG(CAboutDlg) virtual BOOL OnInitDialog(); /AFX_MSG DECLARE_MESSAGE_MAP();CAboutDlg:CAboutDlg() : CDialog(CAboutDlg:IDD) /AFX_DATA_INIT(CAboutDlg) /AFX_DATA_INITvoid CAboutDlg:DoDataExchange(CDataExchange* pDX) CDialog:DoDataExcha
3、nge(pDX); /AFX_DATA_MAP(CAboutDlg) /AFX_DATA_MAPBEGIN_MESSAGE_MAP(CAboutDlg, CDialog) /AFX_MSG_MAP(CAboutDlg) / No message handlers /AFX_MSG_MAPEND_MESSAGE_MAP()/ CAboutDlg message handlersBOOL CAboutDlg:OnInitDialog()OnInitDialog(); / TODO: Add extra initialization here return TRUE;/ CCalcDlg dialo
4、gIMPLEMENT_DYNCREATE(CCalcDlg, CDialog)BEGIN_DISPATCH_MAP(CCalcDlg, CDialog) /AFX_DISPATCH_MAP(CCalcDlg) DISP_PROPERTY_EX(CCalcDlg, Accum, GetAccum, SetAccum, VT_I4)Operand, GetOperand, SetOperand, VT_I4)Operation, GetOperation, SetOperation, VT_I2)Visible, GetVisible, SetVisible, VT_BOOL) DISP_FUNC
5、TION(CCalcDlg, Evaluate, Evaluate, VT_BOOL, VTS_NONE)Clear, Clear, VT_EMPTY, VTS_NONE)Display, Display, VT_EMPTY, VTS_NONE)Close, Close, VT_EMPTY, VTS_NONE)Button, Button, VT_BOOL, VTS_BSTR) /AFX_DISPATCH_MAPEND_DISPATCH_MAP()#ifndef IMPLEMENT_OLECREATE_SINGLE/ MFC will provide this macro in the fut
6、ure. For now, we define it.#define IMPLEMENT_OLECREATE_SINGLE(class_name, external_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) AFX_DATADEF COleObjectFactory class_name:factory(class_name:guid, RUNTIME_CLASS(class_name), TRUE, _T(external_name); const AFX_DATADEF GUID class_name:guid = l, w1, w2
7、, b1, b2, b3, b4, b5, b6, b7, b8 ;/ 62C4DD10-F45E-11cd-8C3D-00AA004BB3B7IMPLEMENT_OLECREATE_SINGLE(CCalcDlg, mfccalc.calculator, 0x62c4dd10, 0xf45e, 0x11cd, 0x8c, 0x3d, 0x0, 0xaa, 0x0, 0x4b, 0xb3, 0xb7);CCalcDlg:CCalcDlg(CWnd* pParent /*=NULL*/) : CDialog(CCalcDlg:IDD, pParent) m_bAutoDelete = TRUE;
8、 / default to auto-delete m_dwRegister = 0; / not registered as active by default /AFX_DATA_INIT(CCalcDlg) / NOTE: the ClassWizard will add member initialization here / Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()-LoadIcon(IDR_MAINFRAME); / Note that Lo
9、adAccelerator does not require DestroyAcceleratorTable m_hAccel = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDD); / clear the contents of the calculator and reset state OnClickedClear(); / enable this object for OLE automation EnableAutomation();CCalcDlg() if (m_dwRegister != 0) RevokeActiveObject(m_dwRegister, NULL);void CCalcDlg: /AFX_DATA_MAP(CCalcDlg) the ClassWizard will add DDX and DDV calls here/ CCalcDlg impl
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1