1、附录附录清单 A Visual C+ MFC concise course MFC introductory remarks Visual C+ not merely is a compiler. It is a comprehensive application procedure development environment,you fully use C+ which has object-oriented characteristic to develop the specialized Windows application procedure. In order to fully
2、 use these characteristics, you must understand the C+ programming language.If you want grasped C+, you must grasp the Microsoft basic kind of storehouse (MFC) level structure. This level structure contained user contact surface in the Windows API,and enabled you very easily to establish the Windows
3、 application procedure by the object-oriented way. This kind of level structure is suitable to all editions Windows and each other is compatible. You use the code which MFC establishes are definitely may transplant. If you want establish a Windows application procedure, how should start? The good be
4、ginning is from designning user contact surface. First, you must decide what kind of user can use this procedure and according to needs to establish the corresponding user contact surface object. The Windows user contact surface has some standards to control, like the button, the menu, roll the stri
5、p and tabulates and so on, this is be familiared with Windows users. You must remember, as a programmer you mustt choose a group as the programmer to control and to decide how to arranges them to the screen. Traditionaly, you need to make the schematic diagram of the user contact surface on the pape
6、r, until you satified with various elements. This is possible to some small project, as well as some big project at early time prototype stages. The next step, is must realize the code. When for any Windows platform establishment application procedure, the programmers all have two kind of choices: C
7、 or C+. Uses C, the programmer is in the Windows application procedure contact surface (API) in the level compiles the code. This contact surface is composed by several hundred C function, these functions reference manual all have the introduction in Windows in the API. Regarding Windows NT, API is
8、called Win32 API, distinguishes to it uses in Windows 3.1 16 API. Microsoft has also provided the C+ storehouse, it is located above any Windows API, can make programmers work to be easier. It is the Microsoft basic kind of storehouse (MFC), this storehouse main merit is the high efficiency. It redu
9、ce massive codes which established in Windows procedure. Simultaneously it has also provided all general C+ programming merit. MFC can be transplant, for example, the code which 3.1 compiles in Windows may very easily transplant to Windows NT or Windows 95. Therefore, MFC is worth the development Wi
10、ndows application procedure method very much which recommends. When you uses MFC, you compile the code is uses to establish the essential user contact surface to control and to custom-made its outward appearance. Simultaneously you also must compile the codes which use to respond the users operation
11、. For example, if the user single-clicks a button, you should have the code to respond. This is the event actuate code, it constituted all applications procedure. Once the application procedure correct response all permissions control, its duty has also completed. You may see, use MFC to establish W
12、indows programming are a quite easy process. Visual C+ application procedure development procedure environment specially suits to uses MFC (also to have other development environments to use MFC), therefore studies MFC and Visual C+ together can strengthen your development procedure ability. Windows
13、 supports several kind of types application procedure windows. A typical application procedure should move in the frame window center. A frame window is an entire function main window, the user may change its size, be smallist, be maximum and so on. Windows also supports two kind of types of dialog
14、boxes: Pattern and non- pattern dialog box. The pattern dialog box once appears on the screen, other parts of the application procedure will respond only when it withdraws. The non- pattern dialog box appears on the screen, other parts of the application procedure will respond, it like fluctuates on
15、 the screen. The simplest Windows application procedure is uses the single documents contact surface (SDI), only one frame window. The Windows clock and watch, the PIF editor, the memorandum and so on are all examples of the SDI application procedure. Windows also provided multi- documents contact s
16、urface form, it might uses in more complex application procedure. The MDI system permission user check many documents in the same application procedure. For example, a text editor may allow the user open many text documents at same time. When uses MDI, the application procedure has a main window, ha
17、s some sub- windows in the host window, in each stature window respectively contains its respective documents. In the MDI frame, the main window has a main menu, it effective to the peakest window in the host frame. Each sub- window all can flod or unflod into a chart sign, the MDI host window also
18、can be aa chart sign. The MDI contact surface possibly can give you second tabletop feeling, it give us very big help for the window management and the deletion chaotic window. Each procedure you established may use its own control, menu structure as well as the dialog box. To choose a good applicat
19、ion procedure contact surface is decided how to chooses and organizes these contact surface objects. Visual C+ resources editor may enable you easily to establishment and has custom-made these contact surface objects. Establishment project and translation code In order to translates the code in Visu
20、al C+, you must have to establish a project. In order to the such small procedure to establishes a project it must make a fuss over a trifling matter, but in any actual procedure, the project concept is extremely useful. A project mainly preserving the following three kind of different types informa
21、tion: It may remember all source programs code document which establishes the executive routine. In this simple example, document HELLO.CPP is the only source document, but in a large-scale application procedure, in order to be advantageous for the management and the maintenance, you may be able to
22、have many different sources documents. The project can maintain these different documents tabulating, and necessity translates them when you establish the next executive routine. It can remember uses the compiler and the coupling option in view of yours application procedure. For example, it can rem
23、ember which storehouse connected in the executive routine, whether you translated in advance document and so on. It can remember the project type which establishes: A control bench application procedure, or window application procedure and so on. If you already understand the project document, then
24、could be very easy to understand the project document function as the machine. Now, we establish a simple project, and translates HELLO.CPP with it. Therefore, first in the menu chooses New from File the option. In Projects in the label, single-clicks Win32 Application.Inputs an appropriate way name
25、 in Location territory or single-clicks Browse button to choose.Inputs hello in Project nameas the project name. This time you can see hello also can appear in Location territory. Single-clicks OK the button. Visual C+ can newly establish HELLO contents, and put all projects document HELLO.OPT, HELL
26、O.NCB, HELLO.DSP and HELLO.DSW into this contents. If you withdraw, later again rewill open this project, then might choose HELLO.DSW. Now, in the screens left side, appearing three labels. InfoView label still in, also newly appeared ClassView and the FileView label. The ClassView label can list al
27、l your procedures, the FileView label give document tabulating in the project. Now it allowed to input routine code. Chooses New in File meno to establish an editor window. In appears in dialog box, choose Files label and Text File. Above then can appear Visual C+ intelligent editor, you may use it to input the procedure code. When input code, you can discover the editor can automatically turn the different type texts into different colors. If you want