Based on the VC 6.0MFC multi-threaded Communication Technology Research

Author
LiXiaoLi
Advisor
LiWeiHua , HeHuaCan
School
Northwestern Polytechnical University
Major
Applied Computer Technology
Classification
TP311.52 Software Development
Degree
Master's thesis
Year
2002
Downloads
1,056
Citations
6

Request the full text

Abstract

Multi-tasking Windows programming, in order to improve the code of time and space efficiency, the widespread adoption of the background procedures and foreground program. For the proper completion of the task, often thread foreground tasks and background tasks, communication between threads is a wide range of requirements. Visual C 6.0 MFC the Windows95/NT environment object-oriented program development environment, with its pre-written a large number of classes and support code for dealing with most of the standard the Wndows programming tasks. High reliability by means of the development environment and the class code, standardization, and the availability of high-quality application code. Shaanxi Provincial Natural Science Foundation of China (2001) - software reverse engineering technology research background, the paper presents a software design (redesign) method, object-oriented analysis and design guidance detailing the Windows Programming an application areas: multi-threaded communications technology. Based on the Microsoft Foundation Class Library achieve MFC (Microsoft Foundation ClassLibrary), multi-threaded communication program. Its significance lies in properly addressed the needs of software reverse engineering, software reuse, software reliability, modular and development time, cost and other aspects of comprehensive requirements. Target system and software requirements analysis, functional model design software available, with the help of MFC, can produce modular, standardized high-quality code, this process can also generate documentation, and program structure hidden in the system in, and can get to class to represent the software model of the target system. Thread into the worker thread (worker thread) and the user interface thread. Worker thread queue and window message loop, so it can not receive messages, it is used to complete the background tasks, such as CPU-intensive calculations, file I / O, and so on. In the the paper communication program implementation, the worker thread is a time-consuming huge loop count, if not the main thread and the worker thread communication, CPU is blocked. The user interface thread message loop queue window, it can receive messages. The paper detailed overview of the MFC library and shows the relationships between the classes, as well as processes, threads, Visual C 6.0 in the realization of. The body is committed to the MFC directly support thread key technologies of communication, that is, through the global variable, through user-defined message, through the event object. Shows the worker thread and the main thread of communication theory, multi-threaded communication program implementation method. The main thread is a dialog-based controls, the worker thread is a time-consuming long loop count. Through user-defined messages and event object communication. If there is no communication of the main thread and the worker thread, the CPU will be blocked for a long time. Achieve their communications, we can easily control this cycle count. Concluded by the multi-threaded communication program design and implementation, multi-threaded communication for those who need a more efficient execution time, storage space, shorter development cycles and higher reliability applications is very useful, and we can the method is extended to industrial control and test applications, such as the structure of the program can be arranged in the main thread and the worker thread, the initialization and coordination of worker threads in the main thread. Arrangements for the time-consuming task by the worker thread in the background, so that the system according to priority scheduling. Communication in accordance with the technique described in these threads to complete a specific task.

Table of contents

Chinese Abstract 3-4 Abstract 4-6 directory 6-8 Chapter 1 Introduction 8-11 < br /> 1.1 issues raised background 8 1.2 Multithreading Overview 8-9 1.3 Basic Application and Implementation Introduction 9 - 10 1.4 The main contents 10-11 Chapter 2 VC 6.0MFC Overview 11-29 2.1 application framework classes 11-13 2.2 window class 13-19 2.3 graphics and printing class 19-20 2.4 collection classes 20-21 2.5 files and database classes 21-22 2.6 OLE support classes 22-25 2.7 Intemet and network classes 25-27 2.8 debugging and exception classes 27-28 2.9 various auxiliary class 28-29 Chapter 3 processes and threads 29-39 3.1 the process of creating 29-34 3.2 process management and termination 34-36 < br /> 3.3 thread creation and termination 36-37 3.4 thread's priority and its management 37-39 Chapter 4, VC 6.0 Multithreading in 39-46 4.1 Use MFC to achieve thread 39-41 4.2 thread synchronization 41-46 Chapter 5 multithreaded communications design technology 46-49 5.1 using global variables communication 46 5.2 using a user-defined message communication 46-47 5.3 use the event object communication 47-49 Chapter 6 multi-threaded communication program 49-53 6.1 design steps 49-52 6.2 source list 52-53 Chapter 7 multi-threaded communications technology application examples 53-57 7.1 basic working principle of radio altimeter altitude 53-55 7.2 design principles and source list 55-57 Chapter 8 Win32C communication API 57 - 71 8.1 open the serial port 57-58 8.2 Close the serial port 58 8.3 configuration serial 58-63 <br / > 8.4 timeout setting 63-64 8.5 to read and write data 64-68 8.6 event-driven I / O 68-69 < br /> 8.7 error handling 69-71 Summary 71-73 1. This major work done 71 2. To be further explored several aspects 71 3. Application Prospects 71-73 Thanks 73-74 References 74

Related dissertations

  1. The multi thread communication program based on VC++6.0 MFC
    LiXiaoLi ·Northwestern Polytechnical University ·2001 ·Master's thesis