WTL multithreading, multiple interfaces & libraries

前端 未结 1 429
广开言路
广开言路 2021-01-26 18:20

I have a Main Thread that displays an interface, within another thread created from the main thread before the Main interface is shown, I create tow other windows sequentially:

相关标签:
1条回答
  • 2021-01-26 19:02

    The problem you seem to have, from your description at least, is that whatever external API you are using via CreateAnObject, it restricts its further use to creation thread. Taking it as is, you are limited to making calls from the creation thread only. Whenever your code running on other theads, including thread hosting CWarningDlg, needs to talk to this API, you need to transfer the call to the CActionDlg thread and proceed from there.

    Synchronization can be SendMessage you already do, or something safer like PostMessage with event/message completion notification.

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