Contents
- README.TXT
- Introduction to the Series
- Introduction to Part I
- ATL Background
- ATL Windowing Classes
- Defining a Window Implementation
- Advanced Message Maps and Mix-in Classes
- Structure of an ATL EXE
- Dialogs in ATL
- I'll Get to WTL, I Promise!
- Copyright and license
- Revision History
This is the stuff I want you to read first, before proceeding on or posting messages to this article's discussion board.
在你在这篇文章的讨论板上处理或回答留言时,我希望你先读一下这篇文章.
This series of articles originally covered WTL 7.0 and written for VC 6 users. Now that VC 8 is out, I felt it was about time to update the articles to cover VC 7.1. (Also, the automatic 6-to-7 conversion done by VC 7.1 doesn't always go smoothly so VC 7.1 users could get stuck when trying to use the demo source code.) So as I go through and update this series, the articles will be updated to reflect new WTL 7.1 features, and I'll have VC 7.1 projects in the source downloads.
这一系列文章基本上含盖了WTL7.0的内容,这也是为VC6用户写的.现在VC8过时了,我觉得是时候更新这些文章包含VC7.1了.(同时,VC7.1提供6到7的自动转换,但是我经常使用的并不顺利,所以VC7.1的用户尝试使用这些代码时可能会遇到困难).所以,当我浏览更新这些系列时,这些文章也将被更新,来反映新的WTL7.1的特性,同时我也在源代码下载里提供VC7.1工程的下载
Important note for VC 2005 users: The Express edition of VC 2005 does not come with ATL (or MFC for that matter) so you can't build ATL or WTL projects with the Express version.
If you are using VC 6, then you need the Platform SDK. You can't use WTL without it. You can use the web install version, or download the CAB files or an ISO image and run the setup locally. Be sure you use the utility to add the SDK include and lib directories to the VC search path. You can find this in the Visual Studio Registration folder in the Platform SDK program group. It's a good idea to get the latest Platform SDK even if you're using VC 7 so you have the latest headers and libs.
Vc2005用户注意:VC2005的简化版并没有提供ATL(由于这些原因也不提供MFC),所以你不能用简化版本来编译ATL或者是WTL工程.
如果你正在使用VC6, 你就需要SDK平台.没有它你不能使用WTL.你要可以使用网页安装版,或者是下载压缩文件或者是ISO镜像然后在本地安装的.确保你使用组件把sdk包含文件和库文件夹加入到vc的搜索路径里.你可以在SDK平台程序包里的Visual Studio Registration文件夹里.最好是使用最新的SDK平台,即使你使用vc7,这样你就可以使用最新的头文件和库了.
You need WTL. Download version 7.1 from Microsoft. See the articles "Introduction to WTL - Part 1" and "Easy installation of WTL" for some tips on installing the files. Those articles are rather out-of-date now, but still contain some good info. The WTL distribution also has a readme file with installation instructions. One thing which I don't think is mentioned in those articles is how to add the WTL files to the VC include path. In VC 6, click Tools|Options and go to the Directories tab. In the Show directories for combo box, select Include files. Then add a new entry that points to the directory where you put the WTL header files. In VC 7, click Tools|Options, click Projects then VC++ Directories. In the Show directories for combo box, select Include files. Then add a new entry that points to the directory where you put the WTL header files.
你需要WTL,下载7.1版本于Mircosoft.请阅读<WTL介绍-第一章>和<WTL简单安装>关于安装文件的一些建议.那些文章现在过时了,但是仍然包含许多有用的信息.WTL发布版也有一个包含有安装指南的readme文件,有一件事我没有考虑到的事在这些文件里被提到的就是怎样把WTL文件加到VC的包含文件路径里.在VC6里,点击工具/选项,然后转到文件夹选项.在显示文件的下拉框里,选择包含文件,,然后增加一个新的入口,它指向你把wtl文件所放的文件夹的.在vc7里,点击工具/选项,点击工程,然后,选择vc++文件,在显示文件夹下拉框里,选择包含文件,然后增加一个新的入口,指向wtl头文件所在目录.
Important: While we're on the subject of the VC 7 include path, you must make a change to the default directory list if you haven't updated your Platform SDK. Make sure that $(VCInstallDir)PlatformSDK/include is first in the list, above ($VCInstallDir)include, as shown here:
You need to know MFC, and know it well enough that you understand what's behind the message map macros, and can edit the code marked "DO NOT EDIT" with no problems.
重点:当我们在vc7.0的包含路径这个选项上时,如果你没有更新你的SDK平台,你必须改变它的默认文件夹.确保$(VCInstallDir)PlatformSDK/include在第一位.在($VCInstallDir)include的上面.像下面所示:
---
你需要知道MFC,并且要理解消息map宏背后的东西.并且要能够编辑那些标记着”DO NOT EDIT”的代码而且不产生问题.
You need to know Win32 API programming, and know it well. If you learned Windows programming by going straight into MFC, without learning how messages work at the API level, you are unfortunately going to have trouble in WTL. If you don't know what a message's WPARAM and LPARAM mean, you should read other articles on API-level programming (there are lots of them here at CodeProject) so you understand.
你需要知道Win32 API编程,并且要非常了解它.如果你是直接进入MFC,而且不学习消息在API级别的工作来学习Windows编程,你非常不幸的将要在wtl中遇到麻烦了.如果你不知道消息的WPARAM和LPARAM的意思.你应该读其它的关于API编程的文章(在CodeProject中有大量的文件),
You need to know C++ template syntax. See the VC Forum FAQ for links to C++ FAQs and template FAQs.
你需要知道C++模板语法.参见VC论坛问题集
Since I haven't used VC 8 yet, I don't know if the sample code will compile on 8. Hopefully the 7-to-8 upgrade process will work better than the 6-to-7 process did. Please post on this article's forum if you have any trouble with VC 8.
自从我不用vc8以来,我不知道示例代码是否能够在vc8下编译通过.希望vc7至vc8升级程序比vc6至vc7升级程序管用.如果你在vc8下面遇到任何问题,请在些文章讨论里提示出来.