The application Framework is a kind of strong cohesive and organized library. A group of co-operative objects, communicating with each other by the flow of messages, and invoking each other's functions to accomplish the task, which is the application Framework.
The application framework is a set of super-class libraries, which can be called the framework and must be the class nature of the tightly occlusal, echoing each other.
The vast majority of class libraries, often in one or two classes, as the basis for most other classes, MFC is the same. CObject is the head of water, where the CObject derives from a number of object-oriented important properties, including Rtti (runtime type recognition), persistence (object preservation), dynamic Creation (dynamically created), Diagnostic (Error diagnosis).
The data processing classes supported by MFC (collection classes) are:
There are 11 types of MFC classes related to exception handling:
Any class derived from CWnd can receive a WM_ window message (except WM_COMMAND).
The so-called window handle and C + + Object alliance, actually CWnd object has a member variable m_hwnd, put the corresponding window handle. Therefore, as long as there is a CWnd object or CWnd object pointer, you can get its window handle.
HWND hwnd = pwnd->m_hwnd;
CCmdTarget is the parent class of CWnd. Derived from it, the class is able to handle the command message wm_command. This class is the message map and most of the key to command message delivery.
The idea of Document/view is to separate the ontology of the data from the display of the data. Due to the creation of files, the Document/view/frame three objects must be created dynamically, so it must be managed by the so-called document template. The document template plays the sticky role of gluing the document and the view to its frame (the outer frame window).
CDocument: When you derive a subclass for your program from CDocument, you should add the member variable to accommodate the file data, and add member functions that are responsible for modifying the file contents and reading and writing the file. The read-write file is serialize by the virtual function.
Here are a few common AFX global functions:
Several so-called object Services are encapsulated in CObject and CRuntimeClass, including "Get Runtime class information (RTTI)", serialization (file read and write), dynamically produce objects, and so on. All classes derived from CObject inherit these functions.
MFC defines some macros for these functions:
The message map and command delivery for MFC is done by the following macros:
Most of MFC's data types are the same as those used by general WIN32 programs, and the following are common data types:
The following are the unique data types of MFC:
"Notes" "The 5th chapter of the general view of MFC" Application Framework