windows GUI 在没有 .NET 框架的情况下简单快速?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7697569/
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
GUI easy and fast without .NET framework?
提问by Tiago
Is there any way to build graphical interfaces in the same rapid and easy way we could do in Visual Studio, but without .NET Framework? I'm looking to native Windows GUIs, so using Qt with Qt Creatoris not an option (and it doesn't need to be cross-platform). Something with the Windows API using C++ would be great (not Delphi).
有没有什么方法可以像在 Visual Studio 中一样快速而简单地构建图形界面,但没有 .NET Framework?我正在寻找本机 Windows GUI,因此将Qt 与 Qt Creator 一起使用不是一种选择(并且它不需要跨平台)。使用 C++ 的 Windows API 会很棒(不是 Delphi)。
I mean, applications like WinSCPreally have its GUIs written entirely by hand?
我的意思是,像WinSCP这样的应用程序真的有完全手工编写的 GUI 吗?
采纳答案by eran
Given:
鉴于:
- You don't want to use Qt
- You want to use Win API
- 你不想使用 Qt
- 您想使用 Win API
The natural option is MFC. It's basically quite a thin wrapper around the Win32 UI API, but VS has an MFC UI designer that will save you a lot of work (no need to manually set the co-ordinates of controls etc.).
自然的选择是MFC。它基本上是围绕 Win32 UI API 的一个非常薄的包装器,但是 VS 有一个 MFC UI 设计器,可以为您节省大量工作(无需手动设置控件的坐标等)。
回答by Imbrondir
My vote is still on Qt.
我的投票仍然在 Qt 上。
I suspect OP is really confusing "Native" with "deployable in a single binary". You can achieve this also with Qt by statically linking Qtdependencies. Contrary to popular belief, the LGPL does not prohibitthis either.
我怀疑 OP 真的将“本机”与“可在单个二进制文件中部署”混淆了。您也可以通过静态链接 Qt依赖项来使用 Qt 实现这一点。与普遍看法相反,LGPL也不禁止这样做。
Now if OP is looking for "deployable in a single super small binary" utorrent style, the answer would differ. A discussion around small binariesseems a good place to look. I would say there is a price to pay in increased development time though.
现在,如果 OP 正在寻找“可在单个超小型二进制文件中部署”的 utorrent 风格,答案就会有所不同。围绕小二进制文件的讨论似乎是一个很好的地方。我会说增加开发时间是要付出代价的。
But I can't agree on Qt not being as native as say MFC.
但我不能同意 Qt 不像 MFC 那样原生。
回答by David Heffernan
Another excellent option is C++Builder with the VCL. This is very similar to WinForms (whose design it clearly inspired) and much more productive than MFC in my opinion.
另一个很好的选择是带有 VCL 的 C++Builder。这与 WinForms(其设计的灵感很明显)非常相似,而且在我看来比 MFC 更有效率。
回答by Christian Rau
As both Qt and MFC are wrappers around the native OS functions for managing windows and other OS utilities (that use Win32 API under the hood and look completely native) there is really no reason to consider the use of MFC over Qt, as it is not more native than Qt. Either your definition of "native" is broken or you haven't told us the whole story.
由于 Qt 和 MFC 都是用于管理 Windows 和其他操作系统实用程序(在幕后使用 Win32 API 并且看起来完全是本机的)的本机 OS 函数的包装器,因此实际上没有理由考虑在 Qt 上使用 MFC,因为它不是比 Qt 更原生。要么你对“本地人”的定义被打破了,要么你没有告诉我们整个故事。
But there are a thousand reasons for considering Qt over MFC, as the latter is a complete pain to use, whereas the former is a cleanly designed, easy to use and still highly flexible library (that strives for nativity by any means possible).
但是有上千个理由考虑 Qt 而不是 MFC,因为后者使用起来非常痛苦,而前者是一个设计简洁、易于使用且仍然高度灵活的库(它以任何可能的方式争取诞生)。
The only way you might see MFC as more native is that it comes from Microsoft (the same company that developed Windows). But that doesn't make it more native. It's still a third party library. This third party worked for the same company as the party developing the Win32 API, but that doesn't make it specifically more tied to the Win32 API, as both were developed independently (and surely by different people).
您可能认为 MFC 更原生的唯一方式是它来自 Microsoft(开发 Windows 的同一家公司)。但这并没有使它更本土化。它仍然是第三方库。该第三方与开发 Win32 API 的一方为同一家公司工作,但这并没有使其与 Win32 API 更紧密地联系在一起,因为两者都是独立开发的(而且肯定是由不同的人开发的)。
回答by CMircea
In addition to MFC, you might want to look into the Windows Template Library.
除了 MFC,您可能还想查看Windows 模板库。