MFC C++ Background Thread

后端 未结 1 1380
情歌与酒
情歌与酒 2021-01-27 01:57

I am making an MFC (document/view) application and I want it to constantly listen in the background for when a device is connected and then automatically copy the files on the d

相关标签:
1条回答
  • 2021-01-27 02:37

    Yes, they behave as a normal background threads, you have a function that gets parameter, and then you can enter your listener loop. I would put this function in separate class, maybe in a form of a singleton class, this way you can easily start/stop your device listener. If you would ever need to send information of progress from this worker thread to GUI, use PostMessage to you GUI windows.

    as always MSDN provides tons of documentation: http://msdn.microsoft.com/en-us/library/975t8ks0%28v=vs.80%29

    0 讨论(0)
提交回复
热议问题