Single Document Interface
lastmod 2021-02-26created 2021-02-251 edits
Describes the basic structure of a single window (SDI; Single Document Interface).
Mfc_sdi.jpg
CWinApp
The Windows application class; the base class that creates the Windows application object.
CFrameWnd
The window class for the main frame; the base class that defines the outer border of the window. Because it inherits from the CWnd class, it handles window messages in common. In the SDI project type, the CMainFrame class is created by inheriting from the CFrameWnd class.
In addition, in the MDI project type, the CMDIFrameWnd and CMDICHildWnd classes are created by inheriting from the CFrameWnd class.
CDocument
A class that reads and saves data inside the application; the base class for documents specified by the application. Because it provides input/output, it is best to use this class for anything related to data input/output. User documents (CMyDocument) inherit from this CDocument class.
CView
A class representing the client or work area of the application; the base class that lets the data in a document be shown on screen through a view. There are various kinds of form windows that inherit from the CView class. It can handle messages coming into the work area. User views (CMyView) inherit from this CView class.
Mfc_sdi_class.png