⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2_1_1.htm

📁 何志丹讲VC学习
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>新建工作空间</title>
</head>

<body>

<table border="0" width="1024" height="542">
  <tr>
    <td width="800" height="200">
    <iframe id=adframe marginwidth=0 marginheight=0 frameborder=0 scrolling=no src='..\..\top.htm' width=800 height=200></iframe>
    </td>
    <td rowspan="3" height="224" valign="top" align="left">
    <iframe id=adframe marginwidth=0 marginheight=0 frameborder=0 scrolling=no src='..\..\right.htm' width=224 height=600></iframe>
    </td>
  </tr>
  <tr>
    <td width="800" height="8"> 
      <p><br>
      <h2><span lang="EN-US">1.2<span style="mso-spacerun: yes">&nbsp; </span></span><span style="font-family:仿宋_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">示例</span></h2>
      <p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">本节给出了多个应用实例。</span><span lang="EN-US">1.2.1</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">节介绍了如何在一个工作空间中包含多个工程;</span><span lang="EN-US">1.2.2</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">节演示了如何增加消息映射;</span><span lang="EN-US">1.2.3</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">节介绍了如何利用类向导关联成员变量;</span><span lang="EN-US">1.2.4</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">节演示了一些调试技巧;</span><span lang="EN-US">1.2.5</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">节演示了利用分隔窗口实现单文档多视图;</span><span lang="EN-US">1.2.6</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">节演示了如何实现多文档。</span></p>
      <h3><span lang="EN-US">1.2.1<span style="mso-spacerun: yes">&nbsp; </span></span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">新建工作空间</span></h3>
      <p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">本实例介绍了如何在一个工作空间中包含多个工程。</span></p>
      <h4><span lang="EN-US">1</span><span style="font-family:黑体;mso-ascii-font-family:
&quot;Times New Roman&quot;">.实例说明</span></h4>
      <p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">一个大的商业软件有几十个甚至几百个模块,划分这么多模块的优点至少有以下几个。</span></p>
      <p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">1</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">)便于维护。修改错误或新增功能只需要修改少量模块。</span></p>
      <p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">2</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">)复用性强。大的软件一般包含一个主程序和若干个工具,工具可以独立运行,是主程序的补充或简化。它们的内核是相同的,模块化使得他们可以共用内核。</span></p>
      <p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">3</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">)便于移植。由于与环境交互的部分都封装在对应模块中,环境变了,只需要修改对应的模块。举个例子,某软件以前只支持</span><span lang="EN-US">Access</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">数据库,现在要支持</span><span lang="EN-US">Oracle</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">,只需要修改与数据库交互的那个模块。</span></p>
      <p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">4</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">)便于分工协作。如果模块划分得不好,一个程序员无意中犯的错误,可能会导致其他程序员无法工作。</span></p>
      <p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">一般而言,一个模块对应一个工程,在新建工程时,会自动生成一个工作空间。如果想一个工作空间包含几个工程,可以用下面的方法。</span></p>
      <h4><span lang="EN-US">2</span><span style="font-family:黑体;mso-ascii-font-family:
&quot;Times New Roman&quot;">.实现</span></h4>
      <p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">下面的这个例子,演示如何让一个工作空间包含两个工程。具体步骤如下:</span></p>
      <p class="a5"><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">1</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">)建立一个文件夹存放代码,如</span><span lang="EN-US">G:\VCBook</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">。</span></p>
      <p class="a5"><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">2</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">)启动</span><span lang="EN-US">VC 6.0</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">,选择菜单“</span><span lang="EN-US">File</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">→</span><span lang="EN-US">New</span><span style="font-family:
楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">”命令打开“</span><span lang="EN-US">New</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">”对话框,选择“</span><span lang="EN-US">Workspace</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">”属性卡。在“</span><span lang="EN-US">Locatin</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">”编辑框中输入</span><span lang="EN-US">Ex010201</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">,在“</span><span lang="EN-US">Workspaces 
      name</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">”编辑框中输入</span><span lang="EN-US">Ex010201</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">,如图</span><span lang="EN-US">1-38</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">所示。单击“</span><span lang="EN-US">OK</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">”按钮,完成新建工作空间。</span></p>
      <p class="MsoNormal"><span lang="EN-US"><!--[if gte vml 1]><v:shapetype id="_x0000_t75"
 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"
 filled="f" stroked="f">
 <v:stroke joinstyle="miter"/>
 <v:formulas>
  <v:f eqn="if lineDrawn pixelLineWidth 0"/>
  <v:f eqn="sum @0 1 0"/>
  <v:f eqn="sum 0 0 @1"/>
  <v:f eqn="prod @2 1 2"/>
  <v:f eqn="prod @3 21600 pixelWidth"/>
  <v:f eqn="prod @3 21600 pixelHeight"/>
  <v:f eqn="sum @0 0 1"/>
  <v:f eqn="prod @6 1 2"/>
  <v:f eqn="prod @7 21600 pixelWidth"/>
  <v:f eqn="sum @8 21600 0"/>
  <v:f eqn="prod @7 21600 pixelHeight"/>
  <v:f eqn="sum @10 21600 0"/>
 </v:formulas>
 <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
 <o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="_x0000_i1031" type="#_x0000_t75" style='width:369pt;
 height:239.25pt'>
 <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msoclip1/01/clip_image001.png"
  o:title=""/>
</v:shape><![endif]-->
      <img src="2_1_1.32.jpg" v:shapes="_x0000_i1031" width="492" height="319"></span></p>
      <p class="a0"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">图</span><span lang="EN-US">1-38<span style="mso-spacerun: yes">&nbsp; 
      </span></span><span style="font-family:宋体;
mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">新建工作空间</span></p>
      <p class="a5"><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">3</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">)在</span><span lang="EN-US">Workspace</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">窗口的工作空间(</span><span lang="EN-US">Workspace</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">)名上单击鼠标右键(如图</span><span lang="EN-US">1-39</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">所示),在弹出的快捷菜单上选择“</span><span lang="EN-US">Add 
      New Project to Workspace</span><span style="font-family:楷体_GB2312;
mso-ascii-font-family:&quot;Times New Roman&quot;">”命令。</span></p>
      <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US"><!--[if gte vml 1]><v:shape
 id="_x0000_i1025" type="#_x0000_t75" style='width:329.25pt;height:192.75pt'
 o:ole="">
 <v:imagedata src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/msoclip1/01/clip_image003.png"
  o:title=""/>
</v:shape><![endif]-->
      <img src="2_1_1.33.jpg" v:shapes="_x0000_i1025" width="439" height="257"><!--[if gte mso 9]><xml>
 <o:OLEObject Type="Embed" ProgID="PBrush" ShapeID="_x0000_i1025"
  DrawAspect="Content" ObjectID="_1235836246">
 </o:OLEObject>
</xml><![endif]-->
      </span></p>
      <p class="a0"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">图</span><span lang="EN-US">1-39 
      </span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">增加工程</span></p>
      <p class="a5"><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">4</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">)在弹出的对话框的“</span><span lang="EN-US">Porject 
      name</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">”编辑框中输入</span><span lang="EN-US">Ex010201Exe</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">,双击工程类型中的“</span><span lang="EN-US">MFC 
      AppWizard</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">exe</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">)”,在弹出的“</span><span lang="EN-US">MFC 
      AppWizard</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">-</span><span lang="EN-US">Step 
      1</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">”对话框中选择“</span><span lang="EN-US">Dialog 
      based</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">”,直接单击“</span><span lang="EN-US">Finish</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">”按钮完成新建工程。</span></p>
      <p class="a5"><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">(</span><span lang="EN-US">5</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:
&quot;Times New Roman&quot;">)单击“</span><span lang="EN-US">File View</span><span style="font-family:楷体_GB2312;mso-ascii-font-family:&quot;Times New Roman&quot;">”标签页,进入</span><span lang="EN-US">File 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -