I've started working with the backgroundworker class to try and keep the UI responsive while I make some expensive API calls. One of the API classes (details here[msdn.microsoft.com]) has its own event handler which I am using to update a progress bar in a small form that pops up. So I'm looking to use the PublishPackage command in a bgw thread and update a progress bar on the UI thread by using the ProgressHandler method.

Everything I've found talks about using the ReportProgress call to run the ProgressChanged routine but in my case there's no loop ... just one call to the API that could take minutes to complete.

I'm assuming the problem lies in the use of a single publisher object in both the UI and BGW threads but I'm not sure of how to mitigate that. Any ideas? I can throw up some pseudo code if it would help.

Thanks,
Bryan