class2group9Word文档格式.docx
《class2group9Word文档格式.docx》由会员分享,可在线阅读,更多相关《class2group9Word文档格式.docx(35页珍藏版)》请在冰点文库上搜索。
![class2group9Word文档格式.docx](https://file1.bingdoc.com/fileroot1/2023-4/28/884797d1-e0f7-471a-8fca-02786aa80b8c/884797d1-e0f7-471a-8fca-02786aa80b8c1.gif)
2.HardwareandSoftwareRequiredto
DevelopProject------------------------------------------6
3.HardwareandSoftwareRequiredtodeveloptheproject
4.RunProject-----------------------------------------------7
5.Sourcecode------------------------------------------------11
-aboutdialog.cpp--------------------------------------------------------------9
aboutdialog.h----------------------------------------------------------------10
myapp.cpp---------------------------------------------------11
myapp.h----------------------------------------------------------------12
myedit.cpp-------------------------------------------------------------12
myedit.h-------------------------------------------------------------13
myframe.cpp----------------------------------------------------------------14
myframe.h-------------------------------------------------------------------29
resource.h-----------------------------------------------------------------30
6.References-------------------------------------------29
1.Systemstudy
ThisprojectisbasedonvisualC++6.0todevelop.Asweallknow,VCdependsonC,C++language.ThemaincomponentisdrivenMFCsystem.whichishighlygreatedprogrammingtool.Itisattractwithadvanced,reasonable,powerful,flexible,efficientenvironment,almostsayVCinwindowsplatformsisomnipotent.Whatisthemostimportantisthattheefficiencyofdevelopingissohigh.Thefollowisourproject.
Whenweclickthe“Find/ReplaceDialogBox“dialogbox,andinputsomewordsinit.Ifweclick”Find/ReplaceDialogBox“dialogbox,itappearsthe”Replace“dialogbox.Wheninput“Mr”inthedialog,thedialogboxwillappearwith“Mr”inthewords.Andifclickthe“FindNext”,thenext“Mr”willappear.Ifit’sreplacedwith“Miss”byclickingthe“ReplaceCurrent“,thedialogboxwillappearwith“Miss”.Ifweclickthebuttonof“ReplaceAll”,thedialogboxwillappearallthe“Miss”insteadof“Mr”inthedialogweinput.Screenshotisgivenbelow.
2.HardwareandSoftwareRequiredtoDeveloptheProject
Processor:
IntelPentium®
Dual-CoreCPUT4200@2.00GHz
BIOS:
Lenovo
Memory:
3GB(Kingston1066mhz)
Displayadapter:
IntelMobile4SeriesExpressChipestFamily(256MBofLenovo)
Systemtype:
64-bitoperatingsystem
Monitorsize:
20
Keyboard:
108keys
Software
Operatingsystem:
MicrosoftWindows7Ultimate(64-bit)
Database:
Accesesversio
ProgrammingLanguage:
VisualC++
IDE:
Visualstudio
3.HardwareandSoftwareRequiredtoRunProject
Accessversio
4.Runtheproject
运用计算器计算:
78*80
在计算器上输入:
78*
输出结果:
6240
5.Sourcecode
aboutdialog.cpp
#include<
afxwin.h>
#include"
aboutdialog.h"
mmsystem.h>
resource.h"
aboutdialog:
:
aboutdialog():
CDialog(IDD_DIALOG1)
{
}
intaboutdialog:
OnInitDialog()
:
PlaySound("
music.wav"
NULL,SND_FILENAME|SND_ASYNC|SND_LOOP);
return1;
voidaboutdialog:
OnOK()
PlaySound(NULL,NULL,NULL);
CDialog:
OnOK();
OnCancel()
OnCancel();
l
aboutdialog.h
classaboutdialog:
publicCDialog
public:
aboutdialog();
intOnInitDialog();
voidOnOK();
voidOnCancel();
};
myapp.cpp
myapp.h"
myedit.h"
myframe.h"
myappa;
intmyapp:
InitInstance()
myframe*p;
p=newmyframe;
p->
ShowWindow
(1);
m_pMainWnd=p;
myapp.h
classmyapp:
publicCWinApp
intInitInstance();
};
myedit.cpp
BEGIN_MESSAGE_MAP(myedit,CEdit)
ON_WM_CREATE()
ON_WM_LBUTTONDOWN()
ON_WM_MOUSEMOVE()
END_MESSAGE_MAP()
intmyedit:
OnCreate(LPCREATESTRUCTl)
CEdit:
OnCreate(l);
m_cur=AfxGetApp()->
LoadStandardCursor(IDC_ARROW);
return0;
voidmyedit:
OnLButtonDown(UINTflags,CPointpt)
OnMouseMove(UINTflags,CPointpt)
SetCursor(m_cur);
myedit.h
classmyedit:
publicCEdit
private:
HCURSORm_cur;
intOnCreate(LPCREATESTRUCTl);
voidOnLButtonDown(UINTflags,CPointpt);
voidOnMouseMove(UINTflags,CPointpt);
DECLARE_MESSAGE_MAP()
myframe.cpp
math.h>
BEGIN_MESSAGE_MAP(myframe,CFrameWnd)
ON_COMMAND(1001,myabout)
ON_COMMAND_RANGE(1,10,numbers0to9)
ON_COMMAND(101,back)
ON_COMMAND(102,ce)
ON_COMMAND(103,c)
ON_COMMAND(106,memorycancel)
ON_COMMAND(107,divide)
ON_COMMAND(108,squareroot)
ON_COMMAND(109,memoryrecall)
ON_COMMAND(110,multiply)
ON_COMMAND(111,percentage)
ON_COMMAND(112,memorystore)
ON_COMMAND(113,minus)
ON_COMMAND(114,onebyx)
ON_COMMAND(115,memoryplus)
ON_COMMAND(117,plusminus)
ON_COMMAND(118,point)
ON_COMMAND(119,plus)
ON_COMMAND(120,equalto)
ON_WM_PARENTNOTIFY()
ON_WM_KEYDOWN()
END_MESSAGE_MAP()
CStringmyframe:
m_helpstrings[]={
"
Nohelptopicisassociatedwiththisitem."
Deletethelastdigitofthedisplayednumber."
Clearsthedisplayednumber."
Clearsthecurrentcalculation."
"
Clearsanynumberstoredinmemory."
Putsthisnumberinthecalculatordisplay."
Divdes."
Calculatesthesquarerootofthedisplayednumber."
Recallsthenumberstoredinmemory.Thenumberremainsinthememory."
Multiplies."
Displaystheresultofthemultiplicationaspercentage."
Storesthedisplayednumberinthememory."
Subracts."
Calculatesthereciprocalofthedisplayednumber."
Addsthedisplayednumbertoanynumberalreadyinmemory."
Changesthesignofthedisplayednumber."
Insertsadecimalpoint."
Adds."
Performsanyoperationontheprevioustwonumbers.Torepeathelastoperationclickagain."
};
myframe:
myframe()
CStringmywindowclass;
CBrushmybrush;
mybrush.CreateStockObject(LTGRAY_BRUSH);
mywindowclass=AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW,
AfxGetApp()->
LoadStandardCursor(IDC_ARROW),
mybrush,
LoadIcon(IDI_ICON1));
Create(mywindowclass,"
Calculator"
WS_SYSMENU|WS_MINIMIZEBOX,CRect(100,100,400,400),0,MAKEINTRESOURCE(IDR_MENU1));
BOOLmyframe:
PreCreateWindow(CREATESTRUCT&
cs)
CFrameWnd:
PreCreateWindow(cs);
cs.dwExStyle&
=~WS_EX_CLIENTEDGE;
returnTRUE;
intmyframe:
OnCreate(LPCREATESTRUCTl)
structbuttoninfo
{
charm_str[5];
intid;
};
buttoninfom[30]=
{
"
100,
Back"
101,
CE"
102,
C"
103,
104,
105,
MC"
106,
7"
8,
8"
9,
9"
10,
/"
107,
Sqrt"