MFC 线程 UI 中的帮助
你好,我使用带有 UI 的 C++ MFC 项目 我有一个类名管理器和类名 calc ,它们应该从 CWinThread 派生。管理器类需要能够将数据发送到 calc 并使用其中的一些函数。我不知道如何开始,我不知道如何使用 CWinThread 以及如何创建踏板。请帮忙。 谢谢
hi im using c++ mfc project with UI treads
i have a class name manager and class name calc which should dervied from CWinThread. the manager class need to have the ability to send data to calc and to use some func from it. i have no idea how to make start i dont know how to use CWinThread and how to create the treads. please help.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不明白你到底想做什么,但据我记得,从美好的 mfc 时代来看,对于大多数问题来说,通常有一个比线程更好/简单的解决方案,使用 Windows 按摩。检查这是否适用于您的情况。
(窗口不一定是你展示的东西......)
I don't understand exactly what you're trying to do, but as far as I remember from the good old mfc days, there was usually a better/simple solution using windows massages than threads to most of the problems. Check if this applys to your situation.
(a window doesn't have to be something you show...)
如果您对 UI 线程一无所知,我想知道您是如何得出需要 UI 线程来完成某些操作的结论的。这是关于 UI 线程的一个很好的教程:UI 线程。
您可以通过调用 PostThreadMessage() API 将数据发送到 UI 线程。
但是,我不明白为什么你的设计要求管理器类能够“使用”属于UI线程类的某些函数。
If you have no idea on UI threads, I wonder how did you conclude that you need UI threads to accomplish something. Here's a nice tutorial on UI threads: UI Threads.
You can send data to an UI thread by calling PostThreadMessage() API.
However, I don't understand why does your design require that the manager class be able to "use" some function that belongs to the UI thread class.