|
||
Windows MFC Basics |
||
MFC The Microsoft Foundation Classes is a C++ class library that encapsulates many of the standard Windows objects. In particular, two of these are of interest: the window (HWND) and device context (HDC). The MFC classes CWnd and CDC encapsulate HWND and HDC respectively. The MFC application class CWinApp is also important.
|
||
Applications An application is just another name for a module (executable program or DLL). In MFC, an application is usually encapsulated by a class derived from the CWinApp class. There can be only one CWinApp-derived class in a module.
|
||
Documents A document in MFC is a file containing user information. With respect to SilverScreen, a drawing (.DRW) is the primary document type. An MFC document is usually represented by a class derived from CDocument.
|
||
Views A view in MFC is a window in which a document is displayed. An MFC view is usually represented by a class derived from CView. CView is a class where handlers for many common Windows messages, including WM_PAINT and WM_SIZE typically reside.
|
||
Frame Windows A frame window in MFC is a window that contains an application’s views, plus other UI elements, such as toolbars and menus. In MFC, a frame window is usually derived from CFrameWnd. MFC supports several different types of applications:
SDI (Single Document Interface), where there is only one view embedded in the frame window, and hence only one document active at a time
MDI (Multiple Document Interface), where several views may be contained by a frame window, and multiple documents open all at once.
Frame windows are often the focal point of UI messages, and SilverEngine uses the frame window, if supplied, as a parent to its own set of UI elements, such as prompting dialogs and popup menus. |