MFC Programmer WTL Guide (2) ATL interface class

Source: Internet
Author: User
Tags documentation

Before you start using WTL or posting a message in the discussion section of this article, I would like to ask you to read the following material first.

You need to develop the Platform SDK (Platform SDK). You need to use WTL without it, you can use the online upgrade to install the development Platform SDK, or you can download all files and install them locally. To add the SDK's include file (. h header file) and the library (. lib file) path to the VC search directory before using, the SDK has off-the-shelf tools to do this, located in the Visual Studio Registration folder of the Development Platform SDK program group.

You need to install WTL. You can download WTL version 7.0 from Microsoft's website, (* edit Note: WTL can also go to VC Knowledgebase Http://www.vckbase.com/tools downloads) before installing, you can view "Introduction to Wtl-part 1" and " Easy installation of WTL "These two articles, to learn about the files to install information, although these articles are somewhat outdated, but still can provide a lot of useful information. One thing that I think should not be mentioned in this article is to tell VC how to search for WTL's included file path, if you use the VC6, click Tools\Options with the mouse, go to Directories tab, select Include Files in the list box showing the path, Then add the WTL's containing file path to the Include file search path list.

You need to know about MFC. A good understanding of MFC will help you understand the macros that are mentioned later about message mapping and be able to edit code labeled "Don't edit" without any problems.

You need to know clearly how to program using the Win32 API. If you are directly from MFC to learn about Windows programming, did not learn the API level of message processing, it is unfortunate that you will be in the use of WTL problems. If you don't understand the meaning of wparam parameters and lparam parameters in Windows messages, you should be aware that you need to read some of these articles (there are a lot of these in codeproject).

You need to know the syntax of C + + templates, you can go to the VC Forum FAQ related connection to seek answers.

I just discussed some features that cover VC 6, but as far as I know, all programs can be used on VC 7. Since I do not use VC 7, I am unable to provide help for those problems appearing in VC 7, but you can safely post your questions here, because other people may help you.

A general introduction to this series of articles

WTL has two sides, indeed it is. It is not as powerful as the MFC interface (GUI) class library, but can produce very small executables. If you like me to use MFC for interface programming, you will find MFC provides the interface control encapsulation is very comfortable to use, let alone MFC built-in message processing mechanism. Of course, if you also like me do not want your program just because the MFC framework to increase the size of hundreds of K, WTL is your choice. Of course, we have to overcome some obstacles:

    • ATL-style template classes look a little weird at first
    • There is no support for the Class wizard, so all message mappings are handled manually.
    • MSDN does not have formal documentation support, you need to go around collecting documentation or even viewing WTL source code.
    • No reference books to buy
    • No official support from Microsoft
    • ATL/WTL Windows and MFC windows are very different, you know about MFC knowledge not all applicable and WTL.

On the other hand, WTL has its own advantages:

    • There is no need to learn or master a complex document/view framework.
    • With MFC's basic interface features, such as the DDX/DDV and command status of the Automatic Update function (translator: such as the menu check mark and enable tag).
    • Enhancements to some of the MFC features (such as a more easy-to-use separator window).
    • Can generate smaller executable files than statically linked MFC programs (translator: All source code for WTL is statically linked to your program).
    • You can fix bugs in the WTL you use without affecting other applications (by contrast, if you fix bugs in a MFC/CRT dynamic library, it can cause other applications to crash.)

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.