WTL(Windows 模板库)是否仍在维护,我应该使用它在 C++ 中创建新的 Windows 程序吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12759972/
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
Is WTL (Windows Template Library) still maintained and should I use it to create new Windows programs in C++?
提问by bodacydo
I'm interested if I still should use WTL to write Windows applications? I really like how it's written but does anyone know if it is still maintained? (Maybe there is a port that someone maintains unofficially?)
我对是否仍应使用 WTL 编写 Windows 应用程序感兴趣?我真的很喜欢它的写法,但有人知道它是否仍在维护吗?(也许有人非正式维护了一个端口?)
If WTL is not recommended to write new Windows applications, what new frameworks are there that I could look up and use?
如果不建议使用 WTL 编写新的 Windows 应用程序,那么我可以查找和使用哪些新框架?
采纳答案by Brian Dishaw
The WTL was opensourced by Microsoft in 2004. Since then it's been updated by the community. The lastest release was in March of 2012. You can check out the latest, see what they are working on, etc from sourceforge.
WTL 于 2004 年由 Microsoft 开源。从那时起,社区对其进行了更新。最新版本是 2012 年 3 月。您可以从 sourceforge 查看最新版本,查看他们正在做什么等。
I don't see why you shouldn't use this to build your app.
我不明白为什么你不应该使用它来构建你的应用程序。
回答by Ryan Ginstrom
I use the WTL myself. The WTL is a thin layer on top of the native Win32 API. It was based on the very rudimentary windowing library included with the ATL.
我自己使用 WTL。WTL 是原生 Win32 API 之上的一个薄层。它基于包含在ATL 中的非常基本的窗口库。
The advantages of the WTL for me are: it produces very lightweight and snappy GUI applications; and if you can follow Petzold, you can figure out the WTL. A lot of the newer GUI libraries make simple things easy, but when you need to delve deep into the Win32 arcana, tend to be more of an impediment than help in my experience.
对我来说,WTL 的优点是:它生成非常轻量级和活泼的 GUI 应用程序;如果您可以关注Petzold,您就可以找出 WTL。许多较新的 GUI 库使简单的事情变得容易,但是当您需要深入研究 Win32 奥秘时,根据我的经验,这往往更像是一种障碍而不是帮助。
Some drawbacks are: it is Windows-only; it relies heavily on inheritance, so you can end up with cumbersome class hierarchies; and it supports multiple Windows versions with #define's, so you can't easily use the latest features available, while gracefully falling back to older versions.
一些缺点是:它仅适用于 Windows;它严重依赖于继承,所以你最终会得到繁琐的类层次结构;并且它支持多个带有 #define 的 Windows 版本,因此您无法轻松使用最新的可用功能,同时优雅地回退到旧版本。
To give you an example of this last drawback, if you want to support back to Windows XP, then your file dialogs are going to look quite dated compared to the Vista+ dialogs.
举一个最后一个缺点的例子,如果您想支持回 Windows XP,那么与 Vista+ 对话框相比,您的文件对话框将显得相当陈旧。
回答by Dave
I know this is an old post. However for those that read this they might be interested to know that the latest version of the WTL on source forge is dated 4/28/2017. The link is https://sourceforge.net/projects/wtl/.
我知道这是一个旧帖子。然而,对于阅读本文的人来说,他们可能有兴趣知道 source forge 上最新版本的 WTL 日期为 2017 年 4 月 28 日。链接是https://sourceforge.net/projects/wtl/。

