WTL 8.0_模块和消息循环

发布于 2024-08-01 16:11:51 字数 280 浏览 4 评论 0原文

我正在开发一个 WTL 项目,实际上是使用 VS2008 的 WTL 8.1。 在许多教程中我都看到了 _Module 全局变量的用法,例如:_Module.AddMessageLoop。 我当前的应用程序在 WinMain 的堆栈中创建一个 CMessageLoop,然后调用 CMessageLoop::Run () 方法。 到目前为止,运行良好。 有人知道在最新的 WTL 版本中调用 _Module.Init、_Module.Term 和 AddMessageLoop 的原因(如果有必要)吗?

谢谢。

I'm working on a WTL project, actually WTL 8.1 with VS2008. In many tutorials I've seen the usage of _Module global variable, e.g: _Module.AddMessageLoop. My current application creates a CMessageLoop in the stack at WinMain and later calls the CMessageLoop::Run () method. So far, it's running well. Anyone the reason (if it's necessary) in latest WTL releases to call _Module.Init, _Module.Term and AddMessageLoop ?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

梦屿孤独相伴 2024-08-08 16:11:51

调用 AddMessageLoop 可以让您的窗口类在消息被翻译之前就对其进行破解; 消息循环将在调用 TranslateMessage 之前调用类的 PreTranslateMessage 方法。

如果您使用 COM,则需要 Init 和 Term 内容。

Calling AddMessageLoop lets your window class get a crack at messages before they're translated; the message loop will call your class's PreTranslateMessage method before calling TranslateMessage.

You need the Init and Term stuff if you're using COM.

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