First knowledge of WTL (PART I)

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.