软件体系结构实验一实验报告.doc_第1页
软件体系结构实验一实验报告.doc_第2页
软件体系结构实验一实验报告.doc_第3页
软件体系结构实验一实验报告.doc_第4页
软件体系结构实验一实验报告.doc_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

广西师范大学、计算机与信息工程学院软件体系结构课程实验一 软件风格编程实验一、 实验内容1、 运用“隐式调用风格”即“事件驱动模式”设计程序界面系统。2、 学习了解基于事件驱动模式的编程的基本设计方法。3、 通过实验,学习和了解WINDOWS的程序平台上的设计实现方法。二、 实验条件1、 硬件环境:单机/网络系统,X86系列计算机,TCP/IP网络平台2、 软件环境:WIN9X/NT/2K/XP 操作系统平台3、 开发环境:VC+6.0开发平台、VC+2008开发平台 4、 参考资料:教材VC+6.0程序设计教程清华大学出版社三、 实验过程步骤1:系统的总体模块结构如图所示,系统基于功能相对独立的原则划分,尽量满足功能内聚的要求,总共由用户管理、客房管理、订房管理、结算管理、服务管理五大功能模块构成整体系统。每个功能模块都根据自身的业务需求,设定了不同的子功能模块,进行进一步的业务细化。步骤2:将图示的调用结构用菜单消息实现。(1) 每个下层模块用子菜单呈现。(2) 底层模块用对话框实现。过程:1、运行VC+6.0开发平台,选择“文件”“新建”“MFC Appwizard(exe)”,工程名称设为“Hotel_MIS”,选择工程存放路径,确定2、选择“单文档”,点击“完成”按钮,进入如图1界面图13、选择“ResourceView”选项卡,依次展开“Hotel_MIS resources”“Menu”文件夹,双击Menu文件夹下的“IDR_MAINFRAME”,出现如图2所示结果图24、添加功能模块,如图3所示图35、在“ResourceView”选项卡,依次展开“Hotel_MIS resources”“Dialog”文件夹,右键点击“Dialog”创建对话框,如图4所示图46、在每个功能模块的属性框将ID改为IDD_ABOUTBOX,编译执行结果如图5所示图5步骤3:总结实验和设计经验,编写实验报告详细代码:/ Hotel_MIS.cpp : Defines the class behaviors for the application./#include stdafx.h#include Hotel_MIS.h#include MainFrm.h#include Hotel_MISDoc.h#include Hotel_MISView.h#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE = _FILE_;#endif/ CHotel_MISAppBEGIN_MESSAGE_MAP(CHotel_MISApp, CWinApp)/AFX_MSG_MAP(CHotel_MISApp)ON_COMMAND(ID_APP_ABOUT, OnAppAbout)/ NOTE - the ClassWizard will add and remove mapping macros here./ DO NOT EDIT what you see in these blocks of generated code!/AFX_MSG_MAP/ Standard file based document commandsON_COMMAND(ID_FILE_NEW, CWinApp:OnFileNew)ON_COMMAND(ID_FILE_OPEN, CWinApp:OnFileOpen)/ Standard print setup commandON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp:OnFilePrintSetup)END_MESSAGE_MAP()/ CHotel_MISApp constructionCHotel_MISApp:CHotel_MISApp()/ TODO: add construction code here,/ Place all significant initialization in InitInstance/ The one and only CHotel_MISApp objectCHotel_MISApp theApp;/ CHotel_MISApp initializationBOOL CHotel_MISApp:InitInstance()AfxEnableControlContainer();/ Standard initialization/ If you are not using these features and wish to reduce the size/ of your final executable, you should remove from the following/ the specific initialization routines you do not need.#ifdef _AFXDLLEnable3dControls();/ Call this when using MFC in a shared DLL#elseEnable3dControlsStatic();/ Call this when linking to MFC statically#endif/ Change the registry key under which our settings are stored./ TODO: You should modify this string to be something appropriate/ such as the name of your company or organization.SetRegistryKey(_T(Local AppWizard-Generated Applications);LoadStdProfileSettings(); / Load standard INI file options (including MRU)/ Register the applications document templates. Document templates/ serve as the connection between documents, frame windows and views.CSingleDocTemplate* pDocTemplate;pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME,RUNTIME_CLASS(CHotel_MISDoc),RUNTIME_CLASS(CMainFrame), / main SDI frame windowRUNTIME_CLASS(CHotel_MISView);AddDocTemplate(pDocTemplate);/ Parse command line for standard shell commands, DDE, file openCCommandLineInfo cmdInfo;ParseCommandLine(cmdInfo);/ Dispatch commands specified on the command lineif (!ProcessShellCommand(cmdInfo)return FALSE;/ The one and only window has been initialized, so show and update it.m_pMainWnd-ShowWindow(SW_SHOW);m_pMainWnd-UpdateWindow();return TRUE;/ CAboutDlg dialog used for App Aboutclass CAboutDlg : public CDialogpublic: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/ Implementationprotected:/AFX_MSG(CAboutDlg)/ No message handlers/AFX_MSGDECLARE_MESSAGE_MAP();CAboutDlg:CAboutDlg() : CDialog(CAboutDlg:IDD)/AFX_DATA_INIT(CAboutDlg)/AFX_DATA_INITvoid CAboutDlg:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pDX);/AFX_DATA_MAP(CAboutDlg)/AFX_DATA_MAPBEGIN_MESSAGE_MAP(CAboutDlg, CDialog)/AFX_MSG_MAP(CAboutDlg)/ No message handlers/AFX_MSG_MAPEND_MESSAGE_MAP()/ App command to run the dialogvoid CHotel_MISApp:OnAppAbout()CAboutDlg aboutDlg;aboutDlg.DoModal();/ CHotel_MISApp message handlers/ Hotel_MISView.cpp : implementation of the CHotel_MISView class/#include stdafx.h#include Hotel_MIS.h#include Hotel_MISDoc.h#include Hotel_MISView.h#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE = _FILE_;#endif/ CHotel_MISViewIMPLEMENT_DYNCREATE(CHotel_MISView, CView)BEGIN_MESSAGE_MAP(CHotel_MISView, CView)/AFX_MSG_MAP(CHotel_MISView)/ NOTE - the ClassWizard will add and remove mapping macros here./ DO NOT EDIT what you see in these blocks of generated code!/AFX_MSG_MAP/ Standard printing commandsON_COMMAND(ID_FILE_PRINT, CView:OnFilePrint)ON_COMMAND(ID_FILE_PRINT_DIRECT, CView:OnFilePrint)ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView:OnFilePrintPreview)END_MESSAGE_MAP()/ CHotel_MISView construction/destructionCHotel_MISView:CHotel_MISView()/ TODO: add construction code hereCHotel_MISView:CHotel_MISView()BOOL CHotel_MISView:PreCreateWindow(CREATESTRUCT& cs)/ TODO: Modify the Window class or styles here by modifying/ the CREATESTRUCT csreturn CView:PreCreateWindow(cs);/ CHotel_MISView drawingvoid CHotel_MISView:OnDraw(CDC* pDC)CHotel_MISDoc* pDoc = GetDocument();ASSERT_VALID(pDoc);/ TODO: add draw code for native data here/ CHotel_MISView printingBOOL CHotel_MISView:OnPreparePrinting(CPrintInfo* pInfo)/ default preparationreturn DoPreparePrinting(pInfo);void CHotel_MISView:OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)/ TODO: add extra initialization before

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论