Windows CE 开发是否建议从 MFC 切换到 QT 或 WTL(或其他 GUI 工具包)?

发布于 2024-08-02 15:48:39 字数 499 浏览 4 评论 0原文

关于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

血之狂魔 2024-08-09 15:48:39

我们在 Windows CE 5.0 上的 Qt 4.5 项目已进入完成阶段,因此我尝试讲述 Qt 开发与 MFC 相比的优点/缺点。
Qt 优点:

  • 良好的 OOP 设计
  • 本机支持的信号/槽抽象允许更快速、轻松地开发
  • Qt 支持许多不同的功能(GUI、文件系统、网络、线程等)
  • LGPL 许可证允许免费开发商业应用程序
  • 开源代码、示例、优秀的文档使得学习曲线非常非常多的步进器
  • 多平台库。我们能够在装有 Vista 操作系统的设备和桌面上运行我们的应用程序,没有任何问题。在 4.6 版本中,添加了 Symbian 支持

Qt 缺点:

  • 相当大的二进制文件(> 10 Mb 的 Core 和 Gui 模块,所有功能都“打开”,但您可以调整库构建并使库更小)
  • 与 MFC 相比,内存和 CPU 使用量大

我认为,与 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:

  • Nice OOP design
  • Natively supported signals/slots abstraction allows develop more rapidly and easily
  • Qt supports many various features (GUI, filesystem, networking, threading, etc)
  • LGPL license allows develop commercial application for free
  • Open sourcecodes, examples, excellent documentation makes learning curve much, much stepper
  • Multiplatform library. We was able to run our application on device and desktop with Vista OS without any trouble. In 4.6 version Symbian support has been added

Qt minuses:

  • Pretty big binaries ( > 10 Mb for Core and Gui module with all features "on", but you can tweak library building and make libs smaller)
  • Big memory and CPU usage comparing to MFC

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).

删除会话 2024-08-09 15:48:39

第一个优点是 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.

执妄 2024-08-09 15:48:39

如果您了解 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.

浅听莫相离 2024-08-09 15:48:39

如果您学习了 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.

江心雾 2024-08-09 15:48:39

对于差异

  • 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文