Windows CE 开发是否建议从 MFC 切换到 QT 或 WTL(或其他 GUI 工具包)?
关于 Windows 的 C++ GUI 工具包有很多问题,但它们主要适用于桌面操作系统版本。
我现在正在启动一个用于 Windows CE 5.0 VGA 手持设备的 C++ 项目,并考虑选择什么 GUI 库。我有一些在 Windows CE 项目中使用 MFC 的经验,但是 SO 中提到了 MFC 的一些已知弱点(例如,使用相当过时的技术、糟糕的抽象、过度使用 C++ 预处理器等)。对于桌面项目,他们主要推荐 QT 和 WTL。同时MFC还有一些特点对于嵌入式开发来说还是相当可观的。
那么,您认为花费一些资源学习新的 GUI 工具包以从 MFC 切换是否合理?在这种情况下您会推荐什么工具包?或者说MFC对于Windows CE嵌入式开发来说仍然是最可观的?
工具包最重要的特征是:适中的 CPU 和内存负载、较小的运行时大小、良好的面向对象设计、符合良好的现代 C++ 实践、陡峭的学习曲线、开发速度、商业外观、方便的调试和设计工具。
(项目中需要:串口通信、线程、绘图和图表、ActiveSync通信。)
There are pretty many questions regarding C++ GUI toolkits for Windows, but they mostly apply to desktop OS versions.
I'm now starting a C++ project for Windows CE 5.0 VGA hand-held device, and thinking about what GUI library to choose. I have some experience using MFC in Windows CE projects, but there are some known weak points of MFC mentioned here at SO (e.g., pretty outdated technologies used, bad abstraction, overuse of C++ preprocessor, etc.). For desktop projects they recommend QT and WTL mostly. At the same time MFC has some characteristics to be still considerable for embedded development.
So, how do you think, is it reasonable to spent some resources learning new GUI toolkit to switch from MFC, and what toolkit would you recommend in this case? Or is MFC still the most considerable for Windows CE embedded development?
The most important characteristics of a toolkit are: moderate CPU and memory load, small runtime size, good object-oriented design, compliance with good modern C++ practices, steep learning curve, development speed, commercial look, handy debug and design tools.
(What is needed in the project: serial port communication, threads, plots and diagrams drawing, ActiveSync communication.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我们在 Windows CE 5.0 上的 Qt 4.5 项目已进入完成阶段,因此我尝试讲述 Qt 开发与 MFC 相比的优点/缺点。
Qt 优点:
Qt 缺点:
我认为,与 Qt 相比,MFC 的主要优势是其最小的内存和 CPU 占用空间。如果这不是问题 - 选择 Qt。
PS Com 端口通信和绘图本身并不包含在 Qt 中,但存在基于 LGPL Qt 的库,它为您提供了此类功能(例如用于绘图的“Qwt”)。
We have Qt 4.5 on Windows CE 5.0 project at finishing stage, so I try to tell about advantages / disadvantages of Qt developing comparing to MFC.
Qt Pluses:
Qt minuses:
I think, that main advantage of MFC comparing to Qt it its minimal memory and CPU footprint. If this is not issue - choose Qt.
P.S. Com port communication and plot drawing not natively included in Qt, but LGPL Qt-based libraries exist, which give you such features (As example "Qwt" for plotting).
第一个优点是 QT 是一个跨平台的库。其次,MFC很让人头疼。使用 MFC 做的最简单的事情可能会变成一个大问题。因此,只要有可能,就尽快从 MFC 迁移到 QT。
First advantage is that QT is a cross-platform lib. Secondly, MFC is an headache. The simplest things to do with MFC may turn to a big problem . So move from MFC to the QT as soon as it is possible.
如果您了解 MFC,那么就坚持使用它:它对于 CE 工作得很好。与桌面 MFC 相比,当然存在一些限制,但通常并不重要。我认为我们发现的主要问题是 MFC8 for CE (VS2005) 不支持打印。
另一方面,如果您有一块空白画布,我建议您使用 .NET——C# 或 VB,无论您觉得最舒服哪个。
If you know MFC then stick with it: it works fine for CE. There are of course some restrictions compared to Desktop MFC, but they are generally not significant. I think the main issue we have found is that printing isn't supported in MFC8 for CE (VS2005).
On the other hand if you have a blank canvas I'd recommend going for .NET -- either C# or VB, whichever you feel most comfortable with.
如果您学习了 QT,您将能够为诺基亚、英特尔和谷歌推出的所有其他(Linux)平台编写代码。这本身就使其成为最适合我的技术!
您可能仍然需要寻找其他库来获取代码的某些其他方面,但使用 QT 来实现 GUI 永远不会是一个糟糕的选择。
If you learn QT, you'll be well placed to write code for all the other (Linux) platforms that are being pushed by the lines of Nokia, Intel and Google. That in itself makes it the most appropriate technology for me!
You may still have to look to other libraries for some of the other aspects of your code, but using QT for the GUI is never going to be a bad choice.
对于差异
Qt
功能丰富、现代设计(对人类更好,对机器不必要)、便携式、开源
MFC 或 WTL
更快,原生感觉,与操作系统集成(如果您的应用程序需要调用系统API,例如以黑客方式控制另一个应用程序,这一点至关重要)。
For diff
Qt
fetaure rich, modern design (better for human, not necessary for machine), portable, open source
MFC or WTL
faster, native feeling, integrate with OS (It is critical if your applicaiton needs to call system APIs, e.g. control another application in a hack way).