相关疑难解决方法(0)

c++ win32: executing a method on ui thread due to an event on background thread

I've got a background thread that is polling a server.
When there's data, i want to handle the data on the ui thread.

If I store the hwnd of the main window.

How can I get a particular method -- static void DataHandler(void*data) to be executed on the ui thread.

我认为创建一个传递hwnd和函数指针的计时器将起作用.
但有更好的方法吗?我可以使用postmessage以某种方式调用datahandler.

另外,我不是在编写ui代码,所以我没有能力修改消息循环中的任何内容.

c++ user-interface winapi asynchronous

3
推荐指数
1
解决办法
6389
查看次数

标签 统计

asynchronous ×1

c++ ×1

user-interface ×1

winapi ×1