2. MFC programming features
If you have used a traditional
In recent years, object-oriented technology has developed rapidly both in theory and practice. The most important thing in object-oriented technology is the concept of "object", which abstracts objective entities such as balloons and bicycles in the real worldProgram"Object" in ". This "object" has certain attributes and methods. The attributes here refer to various characteristic parameters of the object. For example, the volume of a balloon, the length of a bicycle, and the method refers to the functions that the object itself can perform, such as the ability of a balloon to fly, and the ability of a bicycle to scroll. A specific object can have many attributes and Methods. An important feature of object-oriented technology is the encapsulation of objects. For the outside world, it is not necessary to know the attributes of objects, you do not need to know how the object's methods are implemented. Instead, you only need to call the methods provided by the object to complete specific functions. From this we can see that when applying object-oriented technology to program design, programmers only need to care about the details of objects when writing object methods, most of the time is spent on calling object methods to organize these objects for collaborative work.
The full name of MFC is Microsoft fundation classes, which is the basic class library of Microsoft. The essence of MFC is a class library that contains objects already defined by many Microsoft companies. We know that, although the program we want to write varies in terms of functions, in essence, it can be categorized into user interface design, file operations, and multimedia usage, database access and so on. This is exactly the most important reason why Microsoft provides the MFC class library. This class library contains more than one hundred objects most commonly used in program development. During program design, if an object in the class library can complete the required functions, we only need to simply call the methods of existing objects. We can also use the very important "inheritance" method in Object-Oriented Technology to derive our own objects from existing objects in the class library, in this case, in addition to the features and functions of the objects in the class library, we can add the required features and methods as needed to generate a more specialized object, more powerful objects. Of course, you can also create new objects in the program and constantly improve the object functions as needed. The MFC programming method makes full use of the advantages of object-oriented technology, which makes it very rare for us to focus on the implementation details of object methods during programming, at the same time, the powerful functions of various objects in the class library are enough to complete most of the functions required by our program, which makesCodeGreatly reduced, effectively ensuring good program debugging. The various attributes and methods of the provided object in the MFC class library are carefully written and strictly tested, with high reliability. This ensures that the use of the MFC class library does not affect the program reliability and correctness.
It is precisely because
The last thing to note is:
If you develop an application using the Windows programming method, you will be deeply aware that even developing a simple windows application requires a deep understanding of the Windows programming principles, at the same time, you also need to write a lot of code manually. Because the error rate of a program almost increases with the increase of code length, this makes debugging programs very difficult. Therefore, traditional windows programming requires great patience and rich programming experience.