Search code examples
c#.neteventscommessage-pump

Wait for COM Event to complete


How do I block the UI thread while waiting for COM event to complete. I subscribe to update event of COM which signals the event has completed.

MyRData.OnUpdate += OnUpdate;

I do not own the COM code and cannot make changes to it.

I tried AutoResetEvent however that blocks the UI thread and i dont recieve updates from COM.


Solution

  • I finally ended up using Application.DoEvents()