Skip to main content
Participant
October 1, 2019
Question

Callback to main thread

  • October 1, 2019
  • 0 replies
  • 144 views

Hi,

 

I am working on C++ InDesign UI plugin, which interacts with document. The plugin is waiting for orders from outside the plugin, for which it starts a background thread, which is polling a socket periodically. If any change is detected, then it callbacks to the main thread where we can update UI. 

However i got stuck at calling back to the main thread. I tried to use commands to notify the main thread, there is some change that it needed to handle. However i cannot queue commands in the background thread (at least it crashes).

Do you know about any workaround? Or how can i achive this behaviour (constantly, endlessly polling service, and based on that fire an "event" for the main thread to change the text?

 

Thanks in advance,

Balazs

This topic has been closed for replies.