发信人: connor()
整理人: majorsun(1999-11-19 15:39:14), 站内信件
|
发信人: longlife (牛牛), 信区: SoftEng 标 题: rose与vc5.0的协同设计(一) 发信站: BBS 水木清华站 (Fri Nov 6 12:40:13 1998)
Tutorial: Rose 98 with Visual C++ 5.0
This tutorial will go through an example of doing round trip between Rose and Visual C++ 5.0. The procedure for this is:
Build your Rose model as usual
Using the AppWizard in Visual C++, generate a basic VC++ project Code cycle the VC++ project Analyze and export the VC++ project and bring it into Rose Edit your Rose model Generate these changes back into your Visual C++ project Do changes in your VC++ project (Edit compile test) Go to 4 until done This tutorial will cover steps 2-8. Although this tutorial is written for MFC, the same principles apply for ATL and other VC++ projects.
Create an MFC app in Visual C++ 5.0 Create a new directory for your MFC project, for example D:\cpptut Launch Visual C++ (Close any open Workspaces (if any)) In Visual C++, do a File | New... and create a new MFC executable named RoseMFC using the MFC Appwizard (.exe). Choose cpptut\Rosemfc as the location for the project. Make sure the Win32 box is checked. Do OK to go to the next screen of the Wizard.
click to enlarge
[Wizard screen Step 1] Choose to create a Multiple Document Interface application. Click Next. [Wizard screen Step 2] Use the "None" option for data base support. Click Next. [Wizard screen Step 3] Choose "None" for container support. Make sure ActiveX control is on. Click Next. [Wizard screen Step 4] Choose "Docking Toolbar", "Initial Status Bar", and "3D Controls" for the project. Choose a file history of 4. Click Next. [Wizard screen Step 5] Choose to generate source file comments and MFC as a Shared DLL. Click next. [Wizard screen Step 6] Choose "Finish". [Wizard Confirmation Dialog] Make sure the project is going to the correct location, if it is, Choose "OK", otherwise choose cancel and go back to step 4. Your MFC app has now been generated. If you wish, now is a good time to put all your files under version control as your first baseline.
Now you need to build your app. On the menu select Build | Build RoseMFC.exe. This should compile your app.
click to enlarge
When the "RoseMFC.exe - 0 error(s), 0 warning(s)" message appears you have a completed MFC app Test execute the application with the menu selection Build | Execute. The app doesn't do much but, you can exit it with the menu File | Exit. You've made a test MFC app, now you ready to code cycle it.
click to enlarge
Setup Rose Analyzer Launch the Rose analyzer Make sure you have turned on the new ANSI C++ features like bool etc, by Edit | Preferences and have AlternativeOperatorsOk=True NamespacesOk=True NewStyleCastsOk=True TypeBoolOk=True TypeWCharTOk=True MutableOk=True CatchOk=True ExplicitOk=True ExportOk=True TypeIdOK=True TrigraphsOk=True DigraphsOk=True Open the MFC template project by choosing the File | Open menu selection. Go to the directory where you have installed Rose and choose the file c++\projects\mfc50app.pjt
Typically, the analyzer will now ask for a series of pathnames for setup, if you've already tried to reverse engineer a project, this may already be done. Remap $ROSECPPHOME to your c++ directory under your rose install directory. Remap $MFC50 to the mfc\include directory in your Visual C++ install directory Remap $DATA to a place where you will keep data files like \cpptut\data
Remap $DESIGN to a place where you will keep design files like \cpptut\design
Remap $ATL50 to the atl\include directory in your Visual C++ install directory Remap $MSVC50 to the include directory in your Visual C++ install directory
-- 微微的凉风吹拂了衣裙, 淡淡的黄月洒满了一身。 星样的远远的灯成行排队, 灯样的小小的星无声长坠。
※ 来源:.网易 BBS bbs.netease.com.[FROM: 202.96.152.112]
|
|