Microsoft Foundation Classes


The Microsoft Foundation Class (MFC) library is a library of classes for you to use when writing Windows programs. The classes defined in the library can be divided into three parts:

Most MFC classes are derived from the CObject base class. Windows treats all windows as objects so the MFC base class for a window, CWnd, is itself derived (indirectly) from CObject. Classes derived for CWnd include CFrameWnd, CView, CDialog and CPropertySheet. Also, Windows sees everything as a window, even dialog controls (basically, anything Windows sends and receives messages from is a window). Thus the wrapper classes CButton, CEdit, CListBox, CComboBox, etc. are also derived from CWnd.

Some MFC classes not derived from CObject include the simple value types like CString, CTime and CPoint.

As I mentioned earlier, anything Windows sends and receives messages from is a window. All the MFC classes which process messages are derived from the CCmdTarget class. This includes CWnd and all its child classes as well as CWinApp and CDocument, which are not derived from CWnd.