简体   繁体   English

wxWidgets应用程序中的IO重叠

[英]Overlapped IO in wxWidgets application

I'm working on a Windows-only wxWidgets GUI application that shall receive asynchronous notifications from a service process via a named pipe. 我正在使用仅Windows的 wxWidgets GUI应用程序,该应用程序将通过命名管道从服务进程接收异步通知。 I would like to avoid spawning a separate thread for pipe handle monitoring. 我想避免产生单独的线程来监视管道句柄。 Hence, I'm thinking about using overlapped IO. 因此,我正在考虑使用重叠的IO。 My question is: what would be the most straight-forward way of receiving notifications for the pipe handle in the main thread? 我的问题是:在主线程中接收管道句柄通知的最直接方法是什么?

不幸的是,没有办法将任意HANDLE与wxWidgets事件循环集成在一起,因此最好的解决方案是使用单独的线程,如果确实需要修改主线程,则可以调用wxQueueEvent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM