windows ATL 和 WTL 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7816409/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the difference between ATL and WTL?
提问by user1002358
I know "WTL builds onATL", but what does that mean in practical terms?
我知道“WTL建立在ATL之上”,但这实际上意味着什么?
Is ATL a subset of WTL in terms of features? (i.e. are ALL features in ATL also present in WTL?) I notice Wikipedia states ATL's development status is "current" whereas WTL's most recent release is from mid-2009. Does that mean if I want to write Windows 7 software using Glass/Aero and other Windows 7 features then I can't do it with WTL? What about ATL?
就功能而言,ATL 是 WTL 的子集吗?(即 ATL 中的所有功能是否也存在于 WTL 中?)我注意到维基百科声明 ATL 的开发状态是“当前”,而 WTL 的最新版本是从 2009 年中期开始的。这是否意味着如果我想使用 Glass/Aero 和其他 Windows 7 功能编写 Windows 7 软件,那么我不能使用 WTL 来完成?ATL呢?
Is there any performance/memory difference in writing programs in ATL vs WTL?
在 ATL 和 WTL 中编写程序是否有任何性能/内存差异?
回答by Roman R.
ATL is the Microsoft C++ library which primarily implements COM base. A part of it also targets ActiveX controls (which is definitely not a primary goal of the whole library) and it also covers related stuff such as thin wrapper of HWND
(CWindow
class), string manipulation classes CString
, CStringA
, CStringW
, ANSI/Unicode conversion etc.
ATL 是主要实现 COM 基础的 Microsoft C++ 库。它的一部分还针对ActiveX控件(这绝对不是整个库的主要目标),它也包括相关的东西,如薄包装纸HWND
(CWindow
类),字符串处理类CString
,CStringA
,CStringW
,ANSI / Unicode转换等
A part of ATL was branched off into open source ATL Serverlibrary hosted on CodePlex. You can still find some documentation for it on MSDN choosing ATL version back to Visual Studio versions 2002/2003/2005. This mostly covers web development, IIS stuff, and also includes things like regular expressions.
ATL 的一部分被分支到托管在 CodePlex 上的开源ATL 服务器库。您仍然可以在 MSDN 上找到一些相关文档,将 ATL 版本选择回 Visual Studio 版本 2002/2003/2005。这主要包括 Web 开发、IIS 内容,还包括正则表达式之类的内容。
WTL was originally supposed to be used with ATL, and covers GUI related aspects, such as thin wrappers over common controls, GDI object, application GUI framework, frame/video model, custom controls. It provided CString
class before ATL started doing so, and this is one of the things where the two libraries overlap. After WTL went opens source and Microsoft provided free version of Visual Studio, WTL was also updated to be used without ATL so that it could be helpful to build apps using free only tools.
WTL 最初应该与 ATL 一起使用,涵盖了 GUI 相关方面,例如通用控件上的瘦包装器、GDI 对象、应用程序 GUI 框架、帧/视频模型、自定义控件。它CString
在 ATL 开始这样做之前提供了类,这是两个库重叠的地方之一。在 WTL 开源并且微软提供了免费版本的 Visual Studio 之后,WTL 也被更新为可以在没有 ATL 的情况下使用,这样可以帮助使用仅免费的工具构建应用程序。
回答by Hamp
Yes. WTL builds on ATL. However, to call ATL a subset is incorrect. ATL stands on its own as a template based alternative to the MFC approach of programming on Windows OSs. There is much less code bloat. ATL deals with pretty much everything except actual windows, dialogs, etc.
是的。WTL 建立在 ATL 之上。但是,将 ATL 称为子集是不正确的。ATL 独立于 Windows 操作系统上的 MFC 编程方法的基于模板的替代方案。代码膨胀要少得多。ATL 处理除实际窗口、对话框等之外的几乎所有内容。
WTL is a template alternative to the MFC windowing model in the same way that ATL provides an alternative to other windows services. WTL needs ATL. Not the other way around.
WTL 是 MFC 窗口模型的模板替代品,其方式与 ATL 为其他 windows 服务提供替代品的方式相同。WTL 需要 ATL。不是反过来。
The Dunn articles on codeproject provide a pretty good review of WTL.
关于 codeproject 的 Dunn 文章提供了对 WTL 的很好的评论。
WTL for MFC Programmers, Part I - ATL GUI Classesis the first in the series. Navigation links the to other articles in the series are at the bottom of each one.
MFC 程序员的 WTL,第 I 部分 - ATL GUI 类是该系列的第一篇。系列中其他文章的导航链接位于每篇文章的底部。
回答by Mark Ransom
ATL was created for ActiveX controls, i.e. controls that exist in an independent application. WTL is meant to fill in the holes in ATL, by providing classes for the application itself. They are meant to be used together.
ATL 是为 ActiveX 控件创建的,即存在于独立应用程序中的控件。WTL 旨在通过为应用程序本身提供类来填补 ATL 中的漏洞。它们应该一起使用。