I have C# application which has to process the long job. I have some restriction because of which I cannot afford to run that long job in the background thread for e.g. some of the com objects I am using cannot be used in the background thread. How can I have this long job processed in UI thread and have the UI updated with progress report.
Can anything be done on this to make UI responsive while processing the big job?
Thanks in advance,
Bibek Dawadi
You can use COM objects from background threads. Just make sure that the background thread is also an STA thread. (assumption: COM object is an STA object itself).
On Vista Aero and later, Windows will make strange decisions if you don’t paint your windows quickly enough. Like that it will start displaying old versions of the window contents. This will start if your window is not responding to paint messages for a second or two.