How to change pane text of status bar from a thread in MFC?

后端 未结 3 1163
忘掉有多难
忘掉有多难 2021-01-05 16:44

I have a dialog in MFC with a CStatusBar. In a separate thread, I want to change the pane text of status bar. However MFC complains with asserts? How is it done? An example

3条回答
  •  执念已碎
    2021-01-05 17:04

    You should use a message (either with Send- or PostMessage) to notify the UI thread that the status bar text should be updated. Don't try to update UI elements from a worker thread, it's bound to give you pain.

提交回复
热议问题