The code-run effect is shown below:
1. Objective
Although the function of MFC is very powerful, but the appearance of Windows Template Library (WTL), undoubtedly explained that MFC has certain drawbacks. Compared with MFC, the function does not improve MFC. For example, MFC supports Doc/view architecture, and WTL does not support it. At the same time, WTL does not have Microsoft's official support. However, WTL is based on a template (template) with a minimum application of 24KB and, unlike MFC, relies on DLLs. But WTL also realized CString, CRect, CSize, CPoint and other commonly used classes, but also cstatict<tbase>, cbuttont<tbase>, clistboxt<tbase>, Ccomboboxt<tbase> (these can be seen in the WTL library file atlctrls.h, atlctrlw.h, atlctrlx.h) and so on, and the MFC version is not much different.
2. Preparatory work
First install WTL AppWizard, now the highest version should be WTL7.0, run the setup script file directly
This way, when you start VC6.0, file/new, you can see the addition of a ATL/WTL AppWizard on the project Properties page. You can copy WTL's library files (a total of 16. h files) to the VC installation directory Vc98/include, or you can put them in your Engineering folder.
3. Application Example 1---The application of status bar in SDI
(1) File/new, as shown in figure:
(2) After OK,
An SDI (single Document Interface) application typically has only one main window (usually a frame window). The frame window contains menus, toolbars, status bars, and client workspaces called view.
MULTIP-SDI (multiple Threads SDI), just like IE browser, using the "File/new/Window" command, there will be another IE window.
The MDI (multiple Document Interface) application has a main frame window, but there are multiple child frame windows. Each child window has its own view, similar to MFC.
The dialog application is based on a dialog box.