Visual-C++ MFC简要介绍大学毕业论文外文文献翻译及原文
VisualCMFC简要介绍(外文翻译

Introduction to MFC Programming with Visual C++ Version 6.xby Marshall BrainVisual C++ is much more than a compiler. It is a complete application development environment that, when used as intended, lets you fully exploit the object oriented nature of C++ to create professional Windows applications. In order to take advantage of these features, you need to understand the C++ programming language. If you have never used C++, please turn to the C++ tutorials in the C/C++ Tutorials page for an introduction. You must then understand the Microsoft Foundation Class (MFC) hierarchy. This class hierarchy encapsulates the user interface portion of the Windows API, and makes it significantly easier to create Windows applications in an object oriented way. This hierarchy is available for and compatible with all versions of Windows. The code you create in MFC is extremely portable.These tutorials introduce the fundamental concepts and vocabulary behind MFC and event driven programming. In this tutorial you will enter, compile, and run a simple MFC program using Visual C++. Tutotial 2 provides a detailed explanation of the code used in Tutorial 1. Tutorial 3 discusses MFC controls and their customization. Tutorial 4 covers message maps, which let you handle events in MFC.What is the Microsoft Foundations Class LibraryLet's say you want to create a Windows application. You might, for example, need to create a specialized text or drawing editor, or a program that finds files on a large hard disk, or an application that lets a user visualize the interrelationships in a big data set. Where do you beginA good starting place is the design of the user interface. First, decide what the user should be able to do with the program and then pick a set of user interface objects accordingly. The Windows user interface has a number of standard controls, such as buttons, menus, scroll bars, and lists, that are already familiar to Windows users. With this in mind, the programmer must choose a set of controls and decide how they should be arranged on screen. A time-honored procedure is to make a rough sketch of the proposed user interface (by tradition on a napkin or the back of an envelope) and play with the elements until they feel right. For small projects, or for the early prototyping phase of a larger project, this is sufficient.The next step is to implement the code. When creating a program for any Windowsplatform, the programmer has two choices: C or C++. With C, the programmer codes at the level of the Windows Application Program Interface (API). This interface consists of a collection of hundreds of C functions described in the Window's API Reference books. For Window's NT, the API is typically referred to as the "Win32 API," to distinguish it from the original 16-bit API of lower-level Windows products like Windows 3.1.Microsoft also provides a C++ library that sits on top of any of the Windows APIs and makes the programmer's job easier. Called the Microsoft Foundation Class library (MFC), this library's primary advantage is efficiency. It greatly reduces the amount of code that must be written to create a Windows program. It also provides all the advantages normally found in C++ programming, such as inheritance and encapsulation. MFC is portable, so that, for example, code created under Windows 3.1 can move to Windows NT or Windows 95 very easily. MFC is therefore the preferred method for developing Windows applications and will be used throughout these tutorials.When you use MFC, you write code that creates the necessary user interface controls and customizes their appearance. You also write code that responds when the user manipulates these controls. For example, if the user clicks a button, you want to have code in place that responds appropriately. It is this sort of event-handling code that will form the bulk of any application. Once the application responds correctly to all of the available controls, it is finished.You can see from this discussion that the creation of a Windows program is a straightforward process when using MFC. The goal of these tutorials is to fill in the details and to show the techniques you can use to create professional applications as quickly as possible. The Visual C++ application development environment is specifically tuned to MFC, so by learning MFC and Visual C++ together you can significantly increase your power as an application developer.Windows V ocabularyThe vocabulary used to talk about user interface features and software development in Windows is basic but unique. Here we review a few definitions to make discussion easier for those who are new to the environment.Windows applications use several standard user controls:Static text labelsPush buttonsList boxesCombo boxes (a more advanced form of list)Radio boxesCheck boxesEditable text areas (single and multi-line)Scroll barsYou can create these controls either in code or through a "resource editor" that can create dialogs and the controls inside of them. In this set of tutorials we will examine how to create them in code. See the tutorials on the AppWizard and ClassWizard for an introduction to the resource editor for dialogs.Windows supports several types of application windows. A typical application will live inside a "frame window". A frame window is a fully featured main window that the user can re-size, minimize, maximize to fill the screen, and so on. Windows also supports two types of dialog boxes: modal and modeless. A modal dialog box, once on the screen, blocks input to the rest of the application until it is answered. A modeless dialog box can appear at the same time as the application and seems to "float above" it to keep from being overlaid.Most simple Windows applications use a Single Document Interface, or SDI, frame. The Clock, PIF editor, and Notepad are examples of SDI applications. Windows also provides an organizing scheme called the Multiple Document Interface, or MDI for more complicated applications. The MDI system allows the user to view multiple documents at the same time within a single instance of an application. For example, a text editor might allow the user to open multiple files simultaneously. When implemented with MDI, the application presents a large application window that can hold multiple sub-windows, each containing a document. The single main menu is held by the main application window and it applies to the top-most window held within the MDI frame. Individual windows can be iconified or expanded as desired within the MDI frame, or the entire MDI frame can be minimized into a single icon on the desktop. The MDI interface gives the impression of a second desktop out on the desktop, and it goes a long way towards organizing and removing window clutter. Each application that you create will use its own unique set of controls, its own menu structure, and its own dialog boxes. A great deal of the effort that goes into creating any good application interface lies in the choice and organization of these interface objects. Visual C++, along with its resource editors, makes the creation and。
毕业论文外文翻译两篇

毕业论文外文翻译两篇篇一:毕业论文外文翻译外文资料翻译译文:概述是一个统一的Web开发模型,它包括您使用尽可能少的代码生成企业级Web应用程序所必需的各种服务。
作为.NETFramework的一部分提供。
当您编写应用程序的代码时,可以访问.NETFramework中的类。
您可以使用与公共语言运行库(CLR)兼容的任何语言来编写应用程序的代码,这些语言包括MicrosoftVisualBasic、C#、和J#。
使用这些语言,可以开发利用公共语言运行库、类型安全、继承等方面的优点的应用程序。
包括:∙页和控件框架∙编译器∙安全基础结构∙状态管理功能∙应用程序配置∙运行状况监视和性能功能∙调试支持∙XMLWebservices框架∙可扩展的宿主环境和应用程序生命周期管理∙可扩展的设计器环境页和控件框架是一种编程框架,它在Web服务器上运行,可以动态地生成和呈现网页。
可以从任何浏览器或客户端设备请求网页,会向请求浏览器呈现标记(例如HTML)。
通常,您可以对多个浏览器使用相同的页,因为会为发出请求的浏览器呈现适当的标记。
但是,您可以针对诸如MicrosoftInternetExplorer6的特定浏览器设计网页,并利用该浏览器的功能。
支持基于Web的设备(如移动电话、手持型计算机和个人数字助理(PDA))的移动控件。
网页是完全面向对象的。
在网页中,可以使用属性、方法和事件来处理HTML元素。
页框架为响应在服务器上运行的代码中的客户端事件提供统一的模型,从而使您不必考虑基于Web的应用程序中固有的客户端和服务器隔离的实现细节。
该框架还会在页处理生命周期中自动维护页及该页上控件的状态。
使用页和控件框架还可以将常用的UI功能封装成易于使用且可重用的控件。
控件只需编写一次,即可用于许多页并集成到网页中。
这些控件在呈现期间放入网页中。
页和控件框架还提供各种功能,以便可以通过主题和外观来控制网站的整体外观和感觉。
可以先定义主题和外观,然后在页面级或控件级应用这些主题和外观。
基于VisualC的图像检测模块设计毕业论文外文翻译2篇

安徽工业大学工商学院毕业设计(论文)外文文献翻译基于Visual C++的图像检测模块设计毕业设计(论文)题目翻译(1)题目基于PAC的实时人脸检测和跟踪方法翻译(2)题目基于半边脸的人脸检测系仪器仪表专业测控技术与仪器姓名班级学号指导教师译文一基于PAC的实时人脸检测和跟踪方式1摘要:这篇文章提出了复杂背景条件下,实现实时人脸检测和跟踪的一种方式。
这种方式是以主要成分分析技术为基础的。
为了实现人脸的检测,首先,我们要用一个肤色模型和一些动作信息(如:姿势、手势、眼色)。
然后,使用PAC技术检测这些被检验的区域,从而判定人脸真正的位置。
而人脸跟踪基于欧几里德(Euclidian)距离的,其中欧几里德距离在位于以前被跟踪的人脸和比来被检测的人脸之间的特征空间中。
用于人脸跟踪的摄像控制器以这样的方式工作:利用平衡/(pan/tilt)平台,把被检测的人脸区域控制在屏幕的中央。
这个方式还可以扩展到其他的系统中去,例如电信会议、入侵者检查系统等等。
1.引言视频信号处理有许多应用,例如鉴于通讯可视化的电信会议,为残疾人办事的唇读系统。
在上面提到的许多系统中,人脸的检测喝跟踪视必弗成缺的组成部分。
在本文中,涉及到一些实时的人脸区域跟踪[1-3]。
一般来说,按照跟踪角度的分歧,可以把跟踪方式分为两类。
有一部分人把人脸跟踪分为基于识别的跟踪喝基于动作的跟踪,而其他一部分人则把人脸跟踪分为基于边缘的跟踪和基于区域的跟踪[4]。
基于识别的跟踪是真正地以对象识别技术为基础的,而跟踪系统的性能是受到识别方式的效率的限制。
基于动作的跟踪是依赖于动作检测技术,且该技术可以被分成视频流(optical flow)的(检测)方式和动作—能量(motion-energy)的(检测)方式。
基于边缘的(跟踪)方式用于跟踪一幅图像序列的边缘,而这些边缘凡是是主要对象的边界线。
然而,因为被跟踪的对象必需在色彩和光照条件下显示出明显的边缘变化,所以这些方式会遭遇到彩色和光照的变化。
(完整版)_毕业设计(论文)-图书在线销售系统--外文翻译_

一个声明在声明所属的声明域定义了一个名称。除了重载构造函数,方法,索引和操作符名称,在一个声明域种有两个或更多介绍有相同名称成员的声明时,是错误的。对一个而生命域中,包含有相同名称的不同种类成员是永远不可能的。例如,一个声明域种不能包括有相同名称的域和方法。这里有许多种不同类型的声明域,如下表示:
每个块或转换块为标签创建一个分立的声明域。名称通过标签声明贝引入到这个声明域,而名称通过GOTO声明引入到这2个声明域。块的局部变量声明域包括任何嵌套块。因而,在一个嵌套块中不太可能用域嵌套块中的标签想同名称声明一个标签。
在名称贝声明的文本顺序通常并不重要。特别是,文本顺序对于声明和使用名称空间,类型,常数,方法,属性,时间,索引,操作符,构造函数,析构函数和静态构造函数来说并不重要。声明顺序在下面的途径才是重要的:
一个C#程序由一个或多个源文件组成。一个源文件是一个统一字符编码的字符的有序序列。燕文件通常和文件系统种的文件有一一对应关系,但是这个对应关系并不需要。
从概念来讲,一个程序在编译时有四步:
1.预处理,一种文本到文本的转换,这使得可以对程度需文本进行条件饱和和删除。
2.语法分析,它把输入字符序列转换为一个标记序列。
C#的类型系统是统一的,这样任何类型的数据都可以贝看作对象。C#中的任何类型都直接或简介地从BOJIECT类类型派生,而OBJECT是所有类型的最基本类。引用类型的数值贝看作通过对象,这些对象通过把数值看作类型对象来简化。数值类型的数值通过包装和解包装操作来贝当作对象。
毕业设计(论文)外文原文及译文

毕业设计(论文)外文原文及译文一、外文原文MCUA microcontroller (or MCU) is a computer-on-a-chip. It is a type of microcontroller emphasizing self-sufficiency and cost-effectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC).With the development of technology and control systems in a wide range of applications, as well as equipment to small and intelligent development, as one of the single-chip high-tech for its small size, powerful, low cost, and other advantages of the use of flexible, show a strong vitality. It is generally better compared to the integrated circuit of anti-interference ability, the environmental temperature and humidity have better adaptability, can be stable under the conditions in the industrial. And single-chip widely used in a variety of instruments and meters, so that intelligent instrumentation and improves their measurement speed and measurement accuracy, to strengthen control functions. In short,with the advent of the information age, traditional single- chip inherent structural weaknesses, so that it show a lot of drawbacks. The speed, scale, performance indicators, such as users increasingly difficult to meet the needs of the development of single-chip chipset, upgrades are faced with new challenges.The Description of AT89S52The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of In-System Programmable Flash memory. The device is manufactured using Atmel's high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with In-System Programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.The AT89S52 provides the following standard features: 8K bytes ofFlash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.Features• Compatible with MCS-51® Products• 8K Bytes of In-System Programmable (ISP) Flash Memory– Endurance: 1000 Write/Erase Cycles• 4.0V to 5.5V Operating Range• Fully Static Operation: 0 Hz to 33 MHz• Three-level Program Memory Lock• 256 x 8-bit Internal RAM• 32 Programmable I/O Lines• Three 16-bit Timer/Counters• Eight Interrupt Sources• Full Duplex UART Serial Channel• Low-power Idle and Power-down Modes• Interrupt Recovery from Power-down Mode• Watchdog Timer• Dual Data Pointer• Power-off FlagPin DescriptionVCCSupply voltage.GNDGround.Port 0Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedance inputs.Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pullups.Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pullups are required during program verification.Port 1Port 1 is an 8-bit bidirectional I/O port with internal pullups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups.In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively.Port 1 also receives the low-order address bytes during Flash programming and verification.Port 2Port 2 is an 8-bit bidirectional I/O port with internal pullups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pullups.Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register.Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.Port 3Port 3 is an 8-bit bidirectional I/O port with internal pullups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pullups.Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table.Port 3 also receives some control signals for Flash programming and verification.RSTReset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives High for 96 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.ALE/PROGAddress Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming.In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory.If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.PSENProgram Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSENis activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.EA/VPPExternal Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions.This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming.XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating circuit.XTAL2Output from the inverting oscillator amplifier.Special Function RegistersNote that not all of the addresses are occupied, and unoccupied addresses may not be implemented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect.User software should not write 1s to these unlisted locations, since they may be used in future products to invoke new features. In that case, the reset or inactive values of the new bits will always be 0.Timer 2 Registers:Control and status bits are contained in registers T2CON and T2MOD for Timer 2. The register pair (RCAP2H, RCAP2L) are the Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode.Interrupt Registers:The individual interrupt enable bits are in the IE register. Two priorities can be set for each of the six interrupt sources in the IP register.Dual Data Pointer Registers: To facilitate accessing both internal and external data memory, two banks of 16-bit Data Pointer Registers areprovided: DP0 at SFR address locations 82H-83H and DP1 at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1. The user should always initialize the DPS bit to the appropriate value before accessing the respective Data Pointer Register.Power Off Flag:The Power Off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR. POF is set to “1” during power up. It can be set and rest under software control and is not affected by reset.Memory OrganizationMCS-51 devices have a separate address space for Program and Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed.Program MemoryIf the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to external memory.Data MemoryThe AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space.When an instruction accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. Instructions which use direct addressing access of the SFR space. For example, the following direct addressing instruction accesses the SFR at location 0A0H (which is P2).MOV 0A0H, #dataInstructions that use indirect addressing access the upper 128 bytes of RAM. For example, the following indirect addressing instruction, where R0 contains 0A0H, accesses the data byte at address 0A0H, rather than P2 (whose address is 0A0H).MOV @R0, #dataNote that stack operations are examples of indirect addressing, so the upper 128 bytes of data RAM are available as stack space.Timer 0 and 1Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer 1 in the AT89C51 and AT89C52.Timer 2Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event counter. The type of operation is selected by bit C/T2 in the SFR T2CON (shown in Table 2). Timer 2 has three operating modes: capture, auto-reload (up or down counting), and baud rate generator. The modes are selected by bits in T2CON.Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every machine cycle. Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency.In the Counter function, the register is incremented in response to a1-to-0 transition at its corresponding external input pin, T2. In this function, the external input is sampled during S5P2 of every machine cycle. When the samples show a high in one cycle and a low in the next cycle, the count is incremented. The new count value appears in the register during S3P1 of the cycle following the one in which the transition was detected. Since two machine cycles (24 oscillator periods) are required to recognize a 1-to-0 transition, the maximum count rate is 1/24 of the oscillator frequency. To ensure that a given level is sampled at least once before it changes, the level should be held for at least one full machine cycle.InterruptsThe AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These interrupts are all shown in Figure 10.Each of these interrupt sources can be individually enabled or disabledby setting or clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once.Note that Table 5 shows that bit position IE.6 is unimplemented. In the AT89S52, bit position IE.5 is also unimplemented. User software should not write 1s to these bit positions, since they may be used in future AT89 products. Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register T2CON. Neither of these flags is cleared by hardware when the service routine is vectored to. In fact, the service routine may have to determine whether it was TF2 or EXF2 that generated the interrupt, and that bit will have to be cleared in software.The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow. The values are then polled by the circuitry in the next cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which the timer overflows.二、译文单片机单片机即微型计算机,是把中央处理器、存储器、定时/计数器、输入输出接口都集成在一块集成电路芯片上的微型计算机。
中英文翻译

附录:英文技术资料翻译英文原文:Microsoft Visual C++ 6.0 and MFC Brief IntroductionThe Visual C 6.0, referred to as VC or VC6.0, Microsoft introduced a C compiler, high-level language the program translated into machine language (low-level language). Visual C is a powerful visualization software development tools. , With its new version come out since 1993, Microsoft introduced the Visual C 1.0, Visual C has become the tool of choice for professional programmers to develop software. Microsoft Visual C NET (Visual C 7.0), but its application has great limitations, applies only to Windows 2000, Windows XP and Windows NT 4.0. Practice, are based more on the Visual C 6.0 as a platform.Features and shortcomingsCharacteristicVisual C, 6.0, developed by Microsoft, it is not only a C compiler, and a Windows operating system, a visual integrated development environment (integrated development environment, IDE). Visual C 6.0 is composed of many components, including editor, debugger, and AppWizard AppWizard, ClassWizard Class Wizard and other development tools. These components are integrated through a component called Developer Studio for the harmonious development environment. Microsoft's main software products. Visual C is a powerful visualization software development tools. , With its new version come out since 1993, Microsoft introduced the Visual C 1.0, Visual C has become the tool of choice for professional programmers to develop software. Microsoft Visual C NET (Visual C 7.0), but the limitations of its application only applies to Windows 2000, Windows XP and Windows NT 4.0. Practice, are based more on the Visual C 6.0 as a platform.Visual C, 6.0 to have syntax highlighting, automatic compiler functions and advanced debugging features known. For example, it allows users to remotely debug a single step. As well as allow the user during debugging to recompile the modified code, without having to restart the program being debugged. Compile and create the precompiled header file (the stdafx.h), the minimum reconstruction function and the cumulative link (link). These features significantly shorten the procedure edit, compile and link time to spend, particularly notable in thelarge-scale software projects.ShortcomingC is developed by C language, and also supports the C language compiler. Version 6.0 is the most used version of the classic. The biggest shortcoming is its relatively poor support for templates. The latest patch for SP6, the recommended installation, or prone to compile-time state of suspended animation. Supports only the Windows operating system. Currently found with windows 7 compatibility is not good, can not open the cpp file of the phenomenon may occur after a successful installation.MFCmfc is the abbreviation of the Microsoft Foundation Class Library, Microsoft implemented a c class library encapsulates most of the Windows API function, vc is the integrated development environment developed byMicrosoft Corporation c / c, the so-called integrated development environment, that is use it you can edit, co mpile, debug, instead of using the rotation operation of a variety of tools, greater flexibility. Sometimes people say vc it also refers to its internal compiler, integrated development environment must have a compiler, kernel, or what, such as DevC which the kernel of a compiler is the gcc. MFC is a class library, outside, or a framework, you should be tried, to create a new MFC project in vc, the development environment will help you automatically generate a lot of files at the same time it uses mfcxx.dll. xx is the version of mfc kernel, so you see less than the original SDK programming in the message loop, and things in your code, because the MFC framework to help you better package, so you can concentrate on consideration of your application logic, and what not each programming must be repeated, but is a common framework, not the best targeted, of course, they also lose some flexibility and efficiency of the MFC package is very shallow, so little loss of efficiency flexibility, although there are many defects, but still a good thing.MFC and Win32The MFC the Object and the Windows the Object of the relationship between MFC package yes encapsulation of the Win32 API, therefore, understand the Windows Object and the MFC the Object (C, + + object, a C, + + class's instance) between the understanding of MFC's key one. The so-called the Windows the Object (the Windows object) is under Win32 use handle, said of the Windows operating system object; so-called the MFC the Object (the MFC object) is C, + + object, is a C + + class's instance, here (within the scope of this book) the MFC the Object is to have a specific meaning, refers to the package of Windows Object C + + Object does not refer to any C + + the Object. MFC Object and Windows Object is not the same, but the two closely linked. Window object, for example: an MFC window object is a C + + CWnd class (or derived class) instance, is a program created directly. Program execution with the window class constructor call generation, disappear with the call to t he destructor. Windows window is an instance of an internal data structure of the Windows system from a window handle identifies the Windows system to create it and give it to allocate system resources. Windows window after the MFC window object is created by the Create member function of CWnd class to create a window handle is stored in the window object's m_hWnd member variable. Windows window can be destroyed, a program can also be destroyed by the actions of users. MFC window objects and Windows window object relationship shown in Figure 2-1. the other Windows Object and the corresponding MFC Object also has a similar relationship.MFC window class CWndOn Windows systems, the attributes of a window in two places to store: one part on the inside of the window class ", as described above is specified in the login window; another part on the Windows Object, such as: the size of the window, the window position (X, Y axis), the window Z-order of the state of the window (ACTIVE, MINIMIZED, MAXMIZED, RESTORED ...), and other window (parent window, child window ...), the window can receive keyboard or mouse message and so on.In order to express the commonality of all these windows, the MFC design a window base class of the CWnd. It is very important, CWnd to provide a standard generic MFC window procedure, all windows in MFC use this window. As for the common window procedure was able to achieve different operation for each window, that the mysteries of the MFC message mapping mechanism and role of theCreate a window object in MFCMFC to create a window object in two steps, first create an MFC window object, and then create a corresponding Windows window. Memory use, the MFC window object on the stack or heap (new creation) to create. The specific formulation is as follows:Create an MFC window object. By the definition of a CWnd or its derived class instance variables or dynamically create an MFC window instance, the former stack space to create an MFC window objects, which create an MFC window objects in the heap space.Calls the appropriate window to create a function to create a Windows window object.The use of the MFC windowMFC provides a window class, its function and purpose vary. The programmer should choose which classes to use, and how to use them?Direct use of the MFC provides a window class, or start with the MFC window class derived a new C + + class and then use it under normal circumstances, these do not require the programmer to provide the registration code of the window. Need to derive the new C + + class, as the MFC window class is already able to meet the requirements. Derived C + + class inherits the characteristics of the base class and to change or extend its functionality, such as increasing or change the news, events, special processing.The main use or inherit the following MFC window class (the hierarchy shown in Figure 1-1):Framework class CFrameWnd, CMdiFrameWnd;Document framework CMdiChildWnd;View CView, and CView derived view of the special features such as: list CListView edit CEditView tree list CTreeView, RTF CRichEditView the dialog-based CFormView and so on.Dialog box, the CDialog.Typically, the window must be from the framework of the application of these classes are derived and depending on the window or dialog box.Toolbar CToolBarStatus bar CStatusBarOther types of control window, such as CList of the list box, the CEdit of the edit box, combo box the CComboBox button Cbutton.Typically, the direct use of these classes.The destruction of the window in MFCThe window object after use, should be destroyed. MFC, a window object is the destruction of the destruction including the destruction of the HWND of the window object and MFC window object. Under normal circumstances, MFC programming framework automatically handle these.(1) of CFrameWnd and CView derived classThe closure of these windows lead to the destruction of the window function DestroyWindow is called. Windows window is destroyed, the last member function is called by the MFC framework the OnNcDestroy function, which is responsible for the Windows clean-up work, and the last call virtual member function of the PostNcDestroy. CFrameWnd and CView, PostNcDestroy call delete this delete their own MFC window object.Therefore, these windows, as mentioned above, should be in the heap (Heap) is allocated, but, do not use the delete operations on these objects.(2) for Windows Control windowIn their destructor will be called DestroyWidnow to destroy the window. If such a window object allocated on the stack beyond the scope of the destructor call, the MFC window object and its Windows window object is destroyed. If the heap (Heap) is allocated, then explicitly call delete operator, resulting in the destruction of the destructor calls and window.Therefore, this type of window should be allocated on the stack, to avoid the extra code to destroy the window. As mentioned earlier the CMainFrame member variables m_wndStatusBar and m_wndToolBar is one such example.(3) For programmers directly derived from CWnd windowProgrammers can be implemented in a derived class to one of these two mechanisms, and then, in the corresponding specification.Device descriptor table summarizes theWhen an application uses GDI functions, you must first load a specific device driver, and then draw the window device context, such as the specified line width and color, brush styles and colors, fonts, clipping region. Unlike other Win32 structure, equipment description table can not be accessed directly, only indirectly through a series of Win32 function operation.中文译文:Microsoft Visual C++ 6.0 和MFC简要介绍Visual C ++ 6.0,简称VC或者VC6.0,是微软推出的一款C 编译器,将“高级语言”翻译为“机器语言(低级语言)”的程序。
计算机专业毕业设计论文外文文献中英文翻译(Object)

外文资料Object landscapes and lifetimesTechnically, OOP is just about abstract data typing, inheritance, and polymorphism, but other issues can be at least as important. The remainder of this section will cover these issues.One of the most important factors is the way objects are created and destroyed. Where is the data for an object and how is the lifetime of the object controlled? There are different philosophies at work here. C++ takes the approach that control of efficiency is the most important issue, so it gives the programmer a choice. For maximum run-time speed, the storage and lifetime can be determined while the program is being written, by placing the objects on the stack (these are sometimes called automatic or scoped variables) or in the static storage area. This places a priority on the speed of storage allocation and release, and control of these can be very valuable in some situations. However, you sacrifice flexibility because you must know the exact quantity, lifetime, and type of objects while you're writing the program. If you are trying to solve a more general problem such as computer-aided design, warehouse management, or air-traffic control, this is too restrictive.The second approach is to create objects dynamically in a pool of memory called the heap. In this approach, you don't know until run-time how many objects you need, what their lifetime is, or what their exact type is. Those are determined at the spur of the moment while the program is running. If you need a new object, you simply make it on the heap at the point that you need it. Because the storage is managed dynamically, at run-time, the amount of time required to allocate storage on the heap is significantly longer than the time to create storage on the stack. (Creating storage on the stack is often a single assembly instruction tomove the stack pointer down, and another to move it back up.) The dynamic approach makes the generally logical assumption that objects tend to be complicated, so the extra overhead of finding storage and releasing that storage will not have an important impact on the creation of an object. In addition, the greater flexibility is essential to solve the general programming problem.Java uses the second approach, exclusively]. Every time you want to create an object, you use the new keyword to build a dynamic instance of that object.There's another issue, however, and that's the lifetime of an object. With languages that allow objects to be created on the stack, the compiler determines how long the object lasts and can automatically destroy it. However, if you create it on the heap the compiler has no knowledge of its lifetime. In a language like C++, you must determine programmatically when to destroy the object, which can lead to memory leaks if you don’t do it correctly (and this is a common problem in C++ programs). Java provides a feature called a garbage collector that automatically discovers when an object is no longer in use and destroys it. A garbage collector is much more convenient because it reduces the number of issues that you must track and the code you must write. More important, the garbage collector provides a much higher level of insurance against the insidious problem of memory leaks (which has brought many a C++ project to its knees).The rest of this section looks at additional factors concerning object lifetimes and landscapes.1 Collections and iteratorsIf you don’t know how many objects you’re going to need to solve a particular problem, or how long they will last, you also don’t know how to store those objects. How can you know how much space to create for thoseobjects? You can’t, since that information isn’t known until run-time.The solution to most problems in object-oriented design seems flippant: you create another type of object. The new type of object that solves this particular problem holds references to other objects. Of course, you can do the same thing with an array, which is available in most languages. But there’s more. This new object, generally called a container(also called a collection, but the Java library uses that term in a different sense so this book will use “container”), will expand itself whenever necessary to accommodate everything you place inside it. So you don’t need to know how manyobjects you’re going to hold in a container. Just create a container object and let it take care of the details.Fortunately, a good OOP language comes with a set of containers as part of the package. In C++, it’s part of the Standard C++ Library and is sometimes called the Standard Template Library (STL). Object Pascal has containers in its Visual Component Library (VCL). Smalltalk has a very complete set of containers. Java also has containers in its standard library. In some libraries, a generic container is considered good enough for all needs, and in others (Java, for example) the library has different types of containers for different needs: a vector (called an ArrayListin Java) for consistent access to all elements, and a linked list for consistent insertion at all elements, for example, so you can choose the particular type that fits your needs. Container libraries may also include sets, queues, hash tables, trees, stacks, etc.All containers have some way to put things in and get things out; there are usually functions to add elements to a container, and others to fetch those elements back out. But fetching elements can be more problematic, because a single-selection function is restrictive. What if you want to manipulate or compare a set of elements in the container instead of just one?The solution is an iterator, which is an object whose job is to select the elements within a container and present them to the user of the iterator. As a class, it also provides a level of abstraction. This abstraction can be used to separate the details of the container from the code that’s accessing that container. The container, via the iterator, is abstracted to be simply a sequence. The iterator allows you to traverse that sequence without worrying about the underlying structure—that is, whether it’s an ArrayList, a LinkedList, a Stack, or something else. This gives you the flexibility to easily change the underlying data structure without disturbing the code in your program. Java began (in version 1.0 and 1.1) with a standard iterator, called Enumeration, for all of its container classes. Java 2 has added a much more complete container library that contains an iterator called Iterator that does more than the older Enumeration.From a design standpoint, all you really want is a sequence that can be manipulated to solve your problem. If a single type of sequence satisfied all of your needs, there’d be no reason to have different kinds. There are two reasons that you need a choice of containers. First, containers provide different types of interfaces and external behavior.A stack has a different interface and behavior than that of a queue, which is different from that of a set or a list. One of these might provide a more flexible solution to your problem than the other. Second, different containers have different efficiencies for certain operations. The best example is an ArrayList and a LinkedList. Both are simple sequences that can have identical interfaces and external behaviors. But certain operations can have radically different costs. Randomly accessing elements in an ArrayList is a constant-time operation; it takes the same amount of time regardless of the element you select. However, in a LinkedList it is expensive to move through the list to randomly selectan element, and it takes longer to find an element that is further down the list. On the other hand, if you want to insert an element in the middle of a sequence, it’s much cheaper in a LinkedList than in an ArrayList. These and other operations have different efficiencies depending on the underlying structure of the sequence. In the design phase, you might start with a LinkedList and, when tuning for performance, change to an ArrayList. Because of the abstraction via iterators, you can change from one to the other with minimal impact on your code.In the end, remember that a container is only a storage cabinet to put objects in. If that cabinet solves all of your needs, it doesn’t really matter how it is implemented (a basic concept with most types of objects). If you’re working in a programming environment that has built-in overhead due to other factors, then the cost difference between an ArrayList and a LinkedList might not matter. You might need only one type of sequence. You can even imagine the “perfect”container abstraction, which can automatically change its underlying implementation according to the way it is used.2 The singly rooted hierarchyOne of the issues in OOP that has become especially prominent since the introduction of C++ is whether all classes should ultimately be inherited from a single base class. In Java (as with virtually all other OOP languages) the answer is “yes”and the name of this ultimate base class is simply Object. It turns out that the benefits of the singly rooted hierarchy are many.All objects in a singly rooted hierarchy have an interface in common, so they are all ultimately the same type. The alternative (provided by C++) is that you don’t know that everything is the same fundamental type. From a backward-compatibility standpoint this fits the model of C better and can be thought of as less restrictive, but when you want to do full-onobject-oriented programming you must then build your own hierarchy to provide the same convenience that’s built into other OOP languages. And in any new class library you acquire, some other incompatible interface will be used. It requires effort (and possibly multiple inheritance) to work the new interface into your design. Is the extra “flexibility” of C++ worth it? If you need it—if you have a large investment in C—it’s quite valuable. If you’re starting from scratch, other alternatives such as Java can often be more productive.All objects in a singly rooted hierarchy (such as Java provides) can be guaranteed to have certain functionality. You know you can perform certain basic operations on every object in your system. A singly rooted hierarchy, along with creating all objects on the heap, greatly simplifies argument passing (one of the more complex topics in C++).A singly rooted hierarchy makes it much easier to implement a garbage collector (which is conveniently built into Java). The necessary support can be installed in the base class, and the garbage collector can thus send the appropriate messages to every object in the system. Without a singly rooted hierarchy and a system to manipulate an object via a reference, it is difficult to implement a garbage collector.Since run-time type information is guaranteed to be in all objects, you’ll never end up with an object whose type you cannot determine. This is especially important with system level operations, such as exception handling, and to allow greater flexibility in programming.3 Collection libraries and support for easy collection useBecause a container is a tool that you’ll use frequently, it makes sense to have a library of containers that are built in a reusable fashion, so you can take one off the shelf Because a container is a tool that you’ll use frequently, it makes sense to have a library of containers that are built in a reusable fashion, so you can take one off the shelf and plugit into your program. Java provides such a library, which should satisfy most needs.Downcasting vs. templates/genericsTo make these containers reusable, they hold the one universal type in Java that was previously mentioned: Object. The singly rooted hierarchy means that everything is an Object, so a container that holds Objects can hold anything. This makes containers easy to reuse.To use such a container, you simply add object references to it, and later ask for them back. But, since the container holds only Objects, when you add your object reference into the container it is upcast to Object, thus losing its identity. When you fetch it back, you get an Object reference, and not a reference to the type that you put in. So how do you turn it back into something that has the useful interface of the object that you put into the container?Here, the cast is used again, but this time you’re not casting up the inheritance hierarchy to a more general type, you cast down the hierarchy to a more specific type. This manner of casting is called downcasting. With upcasting, you know, for example, that a Circle is a type of Shape so it’s safe to upcast, but you don’t know that an Object is necessarily a Circle or a Shape so it’s hardly safe to downcast unless you know that’s what you’re dealing with.It’s not completely dangerous, however, because if you downcast to the wrong thing you’ll get a run-time error called an exception, which will be described shortly. When you fetch object references from a container, though, you must have some way to remember exactly what they are so you can perform a proper downcast.Downcasting and the run-time checks require extra time for the runningprogram, and extra effort from the programmer. Wouldn’t it make sense to somehow create the container so that it knows the types that it holds, eliminating the need for the downcast and a possible mistake? The solution is parameterized types, which are classes that the compiler can automatically customize to work with particular types. For example, with a parameterized container, the compiler could customize that container so that it would accept only Shapes and fetch only Shapes.Parameterized types are an important part of C++, partly because C++ has no singly rooted hierarchy. In C++, the keyword that implements parameterized types is “template.” Java currently has no parameterized types since it is possible for it to get by—however awkwardly—using the singly rooted hierarchy. However, a current proposal for parameterized types uses a syntax that is strikingly similar to C++ templates.译文对象的创建和存在时间从技术角度说,OOP(面向对象程序设计)只是涉及抽象的数据类型、继承以及多形性,但另一些问题也可能显得非常重要。
大学本科毕业设计论文外文翻译

XXXX大学本科毕业设计(论文)外文翻译原文:How Visual Studio .NET Generates SQL Statements forConcurrency ControlAuthor: Steve SteinVisual Studio TeamAbstract: This paper examines the SQL statements Visual Studio® .NET generates for different kinds of concurrency control, how to modify them for better performance, and how to generate a statement that does not use concurrency control. (5 printed pages).IntroductionAny application that might have multiple users simultaneously attempting to access and modify data needs some form of concurrency control. Otherwise, one user's changes could inadvertently overwrite modifications from other users. The design tools in Visual Studio .NET can create SQL statements that use the "check all values" approach to optimistic concurrency or the "last-in wins" approach to updating data. This paper will explain:∙How each of these statement types are generated.∙How to modify the generated SQL statement for better performance.PrerequisitesYou should have an understanding of:∙Fundamental data concepts, including datasets and data adapters. For more information, see Introduction to Data Access with .∙Concurrency control basics and the options available in Visual Studio .NET. For more information, see Introduction to Data Concurrency in .Where Are the SQL Statements?SQL statements are located in the CommandText property of command objects. SQL commands are automatically generated at design time when configuring data adapters, and at run time when using command builder objects. For more information, see Concurrency and Command BuilderObjets .before us have addressed overlay network programming issues. Even early overlay network Configuring Data Adapters∙Drag a data adapter from the Data tab of the Toolbox∙Drag a table from Server Explorer∙Modifying an existing adapter, by selecting a data adapter and clicking the Configure Data Adapter link at the bottom of the Properties window.Command Builder objects∙Command builder objects are created programmatically at run time. For more information, see (SqlCommandBuilder or OleDbCommandBuilder)Concurrency and Data AdaptersWhen configuring data adapters with the Data Adapter Configuration Wizard, you can decide whether to use optimistic concurrency for the generated Update and Delete statements.Considerations and Caveats∙Your data source must have a primary key in order for the SQL statements to be generated to use optimistic concurrency.∙When creating data adapters by dragging tables from Server Explorer, the data adapter creates Update and Delete statements that are automatically configured for optimisticconcurrency. If you do not want to use optimistic concurrency, you can reconfigure the dataadapter: Right-click the adapter and select Configure Data Adapter from the shortcut menu,then clear the Use optimistic concurrency option of the Advanced SQL Generation OptionsDialog Box. The wizard will recreate the statements without the additional code to check forconcurrency violations.∙When reconfiguring an existing data adapter, note that the advanced settings all revert to their default state. For example, if you cleared the Use optimistic concurrency option when theadapter was originally configured, it will automatically be selected if you reconfigure it, even if you do not access the Advanced SQL Generation Options dialog box.∙If you select the Use existing stored procedures option in the Choose a Query Type section of the Data Adapter Configuration Wizard, the option to use optimistic concurrency is notavailable. The stored procedures will execute as is, and any desired concurrency checkingmust be done within the stored procedure, or programmatically built into your application.。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
毕业设计(论文)外文文献翻译文献、资料中文题目:Visual C++ MFC 简要介绍文献、资料英文题目:文献、资料来源:文献、资料发表(出版)日期:院(部):专业:班级:姓名:学号:指导教师:翻译日期: 2017.02.14Introduction to MFC Programming with Visual C++ Version 6.xby Marshall Brain Visual C++ is much more than a compiler. It is a complete application development environment that, when used as intended, lets you fully exploit the object oriented nature of C++ to create professional Windows applications. In order to take advantage of these features, you need to understand the C++ programming language. If you have never used C++, please turn to the C++ tutorials in the C/C++ Tutorials page for an introduction. You must then understand the Microsoft Foundation Class (MFC) hierarchy. This class hierarchy encapsulates the user interface portion of the Windows API, and makes it significantly easier to create Windows applications in an object oriented way. This hierarchy is available for and compatible with all versions of Windows. The code you create in MFC is extremely portable.These tutorials introduce the fundamental concepts and vocabulary behind MFC and event driven programming. In this tutorial you will enter, compile, and run a simple MFC program using Visual C++. Tutotial 2 provides a detailed explanation of the code used in Tutorial 1. Tutorial 3 discusses MFC controls and their customization. Tutorial 4 covers message maps, which let you handle events in MFC.What is the Microsoft Foundations Class Library?Let's say you want to create a Windows application. You might, for example, need to create a specialized text or drawing editor, or a program that finds files on a large hard disk, or an application that lets a user visualize the interrelationships in a big data set. Where do you begin?A good starting place is the design of the user interface. First, decide what the user should be able to do with the program and then pick a set of user interface objects accordingly. The Windows user interface has a number of standard controls, such as buttons, menus, scroll bars, and lists, that are already familiar to Windows users. With this in mind, the programmer must choose a set of controls and decide how they should be arranged on screen. A time-honored procedure is to make a rough sketch of the proposed user interface (by tradition on a napkin or the back of an envelope) and play with the elements until they feel right. For small projects, or for the early prototyping phase of a larger project, this is sufficient.The next step is to implement the code. When creating a program for any Windows platform, the programmer has two choices: C or C++. With C, the programmer codes at the level of the Windows Application Program Interface (API). This interface consists of a collection of hundreds of C functions described in the Window's API Reference books. For Window's NT, the API is typically referred to as the "Win32 API," to distinguish it from the original 16-bit API of lower-level Windows products like Windows 3.1.Microsoft also provides a C++ library that sits on top of any of the Windows APIs and makes the programmer's job easier. Called the Microsoft Foundation Class library (MFC), this library's primary advantage is efficiency. It greatly reduces the amount of code that must be written to create a Windows program. It also provides all the advantages normally found in C++programming, such as inheritance and encapsulation. MFC is portable, so that, for example, code created under Windows 3.1 can move to Windows NT or Windows 95 very easily. MFC is therefore the preferred method for developing Windows applications and will be used throughout these tutorials.When you use MFC, you write code that creates the necessary user interface controls and customizes their appearance. You also write code that responds when the user manipulates these controls. For example, if the user clicks a button, you want to have code in place that responds appropriately. It is this sort of event-handling code that will form the bulk of any application. Once the application responds correctly to all of the available controls, it is finished.You can see from this discussion that the creation of a Windows program is a straightforward process when using MFC. The goal of these tutorials is to fill in the details and to show the techniques you can use to create professional applications as quickly as possible. The Visual C++ application development environment is specifically tuned to MFC, so by learning MFC and Visual C++ together you can significantly increase your power as an application developer.Windows VocabularyThe vocabulary used to talk about user interface features and software development in Windows is basic but unique. Here we review a few definitions to make discussion easier for those who are new to the environment.Windows applications use several standard user controls:Static text labelsPush buttonsList boxesCombo boxes (a more advanced form of list)Radio boxesCheck boxesEditable text areas (single and multi-line)Scroll barsYou can create these controls either in code or through a "resource editor" that can create dialogs and the controls inside of them. In this set of tutorials we will examine how to create them in code. See the tutorials on the AppWizard and ClassWizard for an introduction to the resource editor for dialogs.Windows supports several types of application windows. A typical application will live inside a "frame window". A frame window is a fully featured main window that the user can re-size, minimize, maximize to fill the screen, and so on. Windows also supports two types of dialog boxes: modal and modeless. A modal dialog box, once on the screen, blocks input to the rest of the application until it is answered. A modeless dialog box can appear at the same time as the application and seems to "float above" it to keep from being overlaid.Most simple Windows applications use a Single Document Interface, or SDI, frame. TheClock, PIF editor, and Notepad are examples of SDI applications. Windows also provides an organizing scheme called the Multiple Document Interface, or MDI for more complicated applications. The MDI system allows the user to view multiple documents at the same time within a single instance of an application. For example, a text editor might allow the user to open multiple files simultaneously. When implemented with MDI, the application presents a large application window that can hold multiple sub-windows, each containing a document. The single main menu is held by the main application window and it applies to the top-most window held within the MDI frame. Individual windows can be iconified or expanded as desired within the MDI frame, or the entire MDI frame can be minimized into a single icon on the desktop. The MDI interface gives the impression of a second desktop out on the desktop, and it goes a long way towards organizing and removing window clutter.Each application that you create will use its own unique set of controls, its own menu structure, and its own dialog boxes. A great deal of the effort that goes into creating any good application interface lies in the choice and organization of these interface objects. Visual C++, along with its resource editors, makes the creation and customization of these interface objects extremely easy.Event-driven Software and V ocabularyAll window-based GUIs contain the same basic elements and all operate in the same way. On screen the user sees a group of windows, each of which contains controls, icons, objects and such that are manipulated with the mouse or the keyboard. The interface objects seen by the user are the same from system to system: push buttons, scroll bars, icons, dialog boxes, pull down menus, etc. These interface objects all work the same way, although some have minor differences in their "look and feel." For example, scroll bars look slightly different as you move from Windows to the Mac to Motif, but they all do the same thing.From a programmer's standpoint, the systems are all similar in concept, although they differ radically in their specifics. To create a GUI program, the programmer first puts all of the needed user interface controls into a window. For example, if the programmer is trying to create a simple program such as a Fahrenheit to Celsius converter, then the programmer selects user interface objects appropriate to the task and displays them on screen. In this example, the programmer might let the user enter a temperature in an editable text area, display the converted temperature in another un-editable text area, and let the user exit the program by clicking on a push-button labeled "quit".As the user manipulates the application's controls, the program must respond appropriately. The responses are determined by the user's actions on the different controls using the mouse and the keyboard. Each user interface object on the screen will respond to events differently. For example, if the user clicks the Quit button, the button must update the screen appropriately, highlighting itself as necessary. Then the program must respond by quitting. Normally the button manages its appearance itself, and the program in some way receives a message from the buttonthat says, "The quit button was pressed. Do something about it." The program responds by exiting.Windows follows this same general pattern. In a typical application you will create a main window and place inside it different user interface controls. These controls are often referred to as child windows-each control is like a smaller and more specialized sub-window inside the main application window. As the application programmer, you manipulate the controls by sending messages via function calls, and they respond to user actions by sending messages back to your code.If you have never done any "event-driven" programming, then all of this may seem foreign to you. However, the event-driven style of programming is easy to understand. The exact details depend on the system and the level at which you are interfacing with it, but the basic concepts are similar. In an event-driven interface, the application paints several (or many) user interface objects such as buttons, text areas, and menus onto the screen. Now the application waits-typically in a piece of code called an event loop-for the user to do something. The user can do anything to any of the objects on screen using either the mouse or the keyboard. The user might click one of the buttons, for example. The mouse click is called an event. Event driven systems define events for user actions such as mouse clicks and keystrokes, as well as for system activities such as screen updating.At the lowest level of abstraction, you have to respond to each event in a fair amount of detail. This is the case when you are writing normal C code directly to the API. In such a scenario, you receive the mouse-click event in some sort of structure. Code in your event loop looks at different fields in the structure, determines which user interface object was affected, perhaps highlights the object in some way to give the user visual feedback, and then performs the appropriate action for that object and event. When there are many objects on the screen the application becomes very large. It can take quite a bit of code simply to figure out which object was clicked and what to do about it.Fortunately, you can work at a much higher level of abstraction. In MFC, almost all these low-level implementation details are handled for you. If you want to place a user interface object on the screen, you create it with two lines of code. If the user clicks on a button, the button does everything needed to update its appearance on the screen and then calls a pre-arranged function in your program. This function contains the code that implements the appropriate action for the button. MFC handles all the details for you: You create the button and tell it about a specific handler function, and it calls your function when the user presses it. Tutorial 4 shows you how to handle events using message mapsAn ExampleOne of the best ways to begin understanding the structure and style of a typical MFC program is to enter, compile, and run a small example. The listing below contains a simple "hello world" program. If this is the first time you've seen this sort of program, it probably will not make a lot of sense initially. Don't worry about that. We will examine the code in detail in the nexttutorial. For now, the goal is to use the Visual C++ environment to create, compile and execute this simple program.//hello.cpp#include <afxwin.h>// Declare the application classclass CHelloApp : public CWinApp{public:virtual BOOL InitInstance();};// Create an instance of the application classCHelloApp HelloApp;// Declare the main window classclass CHelloWindow : public CFrameWnd{CStatic* cs;public:CHelloWindow();};// The InitInstance function is called each// time the application first executes.BOOL CHelloApp::InitInstance(){m_pMainWnd = new CHelloWindow();m_pMainWnd->ShowWindow(m_nCmdShow);m_pMainWnd->UpdateWindow();return TRUE;}// The constructor for the window classCHelloWindow::CHelloWindow(){// Create the window itselfCreate(NULL,"Hello World!",WS_OVERLAPPEDWINDOW,CRect(0,0,200,200));// Create a static labelcs = new CStatic();cs->Create("hello world",WS_CHILD|WS_VISIBLE|SS_CENTER,CRect(50,80,150,150),this);}This small program does three things. First, it creates an "application object." Every MFC program you write will have a single application object that handles the initialization details of MFC and Windows. Next, the application creates a single window on the screen to act as the main application window. Finally, inside that window the application creates a single static text label containing the words "hello world". We will look at this program in detail in the next tutorial to gain a complete understanding of its structure.The steps necessary to enter and compile this program are straightforward. If you have not yet installed Visual C++ on your machine, do so now. You will have the option of creating standard and custom installations. For the purposes of these tutorials a standard installation is suitable and after answering two or three simple questions the rest of the installation is quick and painless.Start VC++ by double clicking on its icon in the Visual C++ group of the Program Manager. If you have just installed the product, you will see an empty window with a menu bar. If VC++ has been used before on this machine, it is possible for it to come up in several different states because VC++ remembers and automatically reopens the project and files in use the last time it exited. What we want right now is a state where it has no project or code loaded. If the program starts with a dialog that says it was unable to find a certain file, clear the dialog by clicking the "No" button. Go to the Window menu and select the Close All option if it is available. Go to the File menu and select the Close option if it is available to close any remaining windows. Now you are at the proper starting point. If you have just installed the package, you will see a window that looks something like this:This screen can be rather intimidating the first time you see it. To eliminate some of the intimidation, click on the lower of the two "x" buttons () that you see in the upper right hand corner of the screen if it is available. This action will let you close the "InfoViewer Topic" window. If you want to get rid of the InfoViewer toolbar as well, you can drag it so it docks somewhere along the side of the window, or close it and later get it back by choosing the Customize option in the Tools menu.What you see now is "normal". Along the top is the menu bar and several toolbars. Along the left side are all of the topics available from the on-line book collection (you might want to explore by double clicking on several of the items you see there - the collection of information found in the on-line books is gigantic). Along the bottom is a status window where various messages will be displayed.Now what? What you would like to do is type in the above program, compile it and run it. Before you start, switch to the File Manager (or the MS-DOS prompt) and make sure your drive has at least five megabytes of free space available. Then take the following steps.Creating a Project and Compiling the CodeIn order to compile any code in Visual C++, you have to create a project. With a very small program like this the project seems like overkill, but in any real program the project concept is quite useful. A project holds three different types of information:It remembers all of the source code files that combine together to create one executable. In this simple example, the file HELLO.CPP will be the only source file, but in larger applications you often break the code up into several different files to make it easier to understand (and also to make it possible for several people to work on it simultaneously). The project maintains a list of the different source files and compiles all of them as necessary each time you want to create a new executable.It remembers compiler and linker options particular to this specific application. For example,it remembers which libraries to link into the executable, whether or not you want to use pre-compiled headers, and so on.It remembers what type of project you wish to build: a console application, a windows application, etc.If you are familiar with makefiles, then it is easy to think of a project as a machine-generated makefile that has a very easy-to-understand user interface to manipulate it. For now we will create a very simple project file and use it to compile HELLO.CPP.To create a new project for HELLO.CPP, choose the New option in the File menu. Under the Projects tab, highlight Win32 Application. In the Location field type an appropriate path name or click the Browse button. Type the word "hello" in for the project name, and you will see that word echoed in the Location field as well. Click the OK button. In the next window, use the default selection "An empty project", click "Finish", then click "OK" once more in the next window. Notice there is an option for the typical "Hello World" application, however it skips a few important steps you are about to take. Visual C++ will create a new subdirectory named HELLO and place the project files named HELLO.OPT, HELLO.NCB, HELLO.DSP, and HELLO.DSW in that directory. If you quit and later want to reopen the project, double-click on HELLO.DSW.The area along the left side of the screen will now change so that three tabs are available. The InfoView tab is still there, but there is now also a ClassView and a FileView tab. The ClassView tab will show you a list of all of the classes in your application and the FileView tab gives you a list of all of the files in the project.Now it is time to type in the code for the program. In the File menu select the New option to create a new editor window. In the dialog that appears, make sure the Files tab is active and request a "C++ Source File". Make sure the "Add to Project" option is checked for Project "hello", and enter "hello" for "File name". Visual C++ comes with its own intelligent C++ editor, and you will use it to enter the program shown above. Type (copy/paste) the code in the listing into the editor window. You will find that the editor automatically colors different pieces of text such as comments, key words, string literals, and so on. If you want to change the colors or turn the coloring off, go to the Options option in the Tools menu, choose the Format tab and select the Source Windows option from the left hand list. If there is some aspect of the editor that displeases you, you may be able to change it using the Editor tab of the Options dialog.After you have finished entering the code, save the file by selecting the Save option in the File menu. Save it to a file named HELLO.CPP in the new directory Visual C++ created.In the area on the left side of the screen, click the FileView tab and expand the tree on the icon labeled "hello files", then expand the tree on the folder icon labeled "Source Files". You will see the file named HELLO.CPP. Click on the ClassView tab and expand the "hello classes" tree and you will see the classes in the application. You can remove a file from a project at any time by going to the FileView, clicking the file, and pressing the delete button.Finally, you must now tell the project to use the MFC library. If you omit this step the project。