Microsoft Visual C++ 6.0 MFC Library Reference Class Library Reference (1)

Author: (USA) Microsoft
Translator: Hope Book Studio
Publisher: Beijing Hope Computer Company / Beijing Hope Electronic Publishing House
Publication Date: 1999-04-01
Features: C and C++ languages have become the de facto universal languages for professional developers. This book is a reference manual for the Visual C++ class library, arranged in alphabetical order by class name. Each class is divided into two main parts: member functions and data members, providing detailed explanations of the usage of each component. It is a comprehensive reference manual for the Microsoft Visual C++ 6.0 Foundation Class Library (MFC), and its comprehensiveness and authority are the book's greatest features. The content is published in two volumes. This set is a complete reference manual for the Microsoft Visual C++ 6.0 Foundation Class Library (MFC). Its comprehensiveness and authority are the book's greatest features. The MFC library is divided into root classes, MFC application structure classes, window, dialog, and control classes, drawing and printing classes, simple data type classes, array, list, and map classes, file and database classes, Internet and network classes, OLE classes, debugging and exception classes, and more. Each category is an important topic in application programming or a specific aspect. This book lists all MFC classes in alphabetical order and provides detailed explanations of each class's members, including member functions and data members, as well as the relationships between classes, such as inheritance. For typical usage, in addition to explaining with conventional methods, this book also includes concise code examples for readers to study and analyze. This book is a reference book for developers working on Microsoft Visual C++ 6.0 (MFC) applications and development, as well as a self-study and teaching reference for students and teachers in higher education institutions. The CD included in the second volume of this book contains two parts: 1. An e-book to the first and second volumes of this book; 2. A free "Mastering Visual C++ 5.0" multimedia learning software.
Excerpt: The ability to directly call any Windows C function makes it easier to convert existing C applications to C++. It allows better utilization of existing C language Windows programming experience, making the Windows API in C++ more user-friendly than in C. It enables more effective use of powerful and complex abstract concepts, such as ActiveX, database support, printing, toolbars, and status bars. It provides a true C++ Windows API application framework. The core of the Microsoft Foundation Class Library is a Windows API encapsulated mostly in C++. The classes in the library represent windows, dialog boxes, device contexts, and common GDI objects, such as brushes and pens, controls, and other standard Windows items. These classes provide a familiar C++ member function interface for the structures they encapsulate. For more information on using these classes, see the online documentation "Visual C++ Programmer's Guide" under "Windows Object Topics." However, the Microsoft Foundation Class Library also provides an additional layer of application functionality built on top of the C++ encapsulation of the Windows API. This layer is a Windows application framework that provides a common interface for most Windows programming, including toolbars, status bars, printing, print preview, database support, and ActiveX support. For a detailed explanation of the framework, see the online documentation "Visual C++ Programmer's Guide" under "Using Classes to Write Windows Applications." The online documentation "Visual C++ Tutorial" provides the Scribble sample, which guides you through application framework programming.
Relationship with C Language API: The only distinguishing feature of the Microsoft Foundation Class Library compared to other Windows class libraries is its close mapping relationship with the Windows API written in C. Additionally, you can freely mix direct calls to the Windows API with calls to the class library. This direct access does not mean that classes can completely replace the API. Developers may sometimes need to call Windows functions directly, such as SetCursor and GetSystemMetrics. A Windows function is replaced by a class member function only when there is a clear advantage. Since you may need to call Windows functions, you should refer to the C language Windows API documentation. This documentation is written in Microsoft Visual C++ language. Two helpful books are "Advanced Windows" by Jeffrey Richter and "Programming Windows 95" by Charles Petzold. Both books are published by Microsoft. The examples in these books can be easily converted to Microsoft base classes. For additional information on examples and programming with the Microsoft Foundation Class Library, see "Inside Visual C++," written by David J. Kruglinski and published by Microsoft. For an overview of how to use the Microsoft Foundation Class Library framework, see the online documentation "Visual C++ Programmer's Guide" under "Using Classes to Write Windows Applications." This overview is no longer mentioned in the library reference.
Summary of Classes by Category: Below is a brief summary of the classes in the Microsoft Foundation Class Library, categorized to help you load the classes you need. In some cases, a class may be listed in multiple categories. To understand class inheritance, use the class hierarchy chart.
Root Classes: CObject Most classes in the Microsoft Foundation Class Library are derived from the single base class at the top of the class hierarchy, CObject. CObject provides useful functionality for all classes it derives from. For more information on CObject and its functionality, see the online documentation "Visual C++ Programmer's Guide" under "CObject Class Topics." CObject is the ultimate base class for most MFC classes. It supports serialization of data and obtaining runtime information about a class. CRuntimeClass is used to determine the correct class structure of an object at runtime.
MFC Application Structure Classes: MFC application construction classes help in constructing a framework application. They provide common functionality for most applications. You can fill in application-specific functionality within the framework. Typically, you can derive new classes from these construction classes and add new members and/or override existing member functions. AppWizard generates several types of applications, all of which use the application framework in different ways. SDI (Single Document Interface) and MDI (Multiple Document Interface) applications make full use of the document/view framework portion of the framework. Other application types, such as dialog-based applications, form-based applications, and DLLs, use only some of the document/view framework functionality. A document-template object associates a class with each document/view/framework set. Although the document/view structure is not mandatory in MFC applications, it offers many benefits. The MFC OLE container and server support the document/view structure. The document/view structure also supports printing and print preview.

📌 Related Posts