|
-
Feb 9th, 2012, 02:46 PM
#1
Thread Starter
New Member
[RESOLVED] Backgroundworker and objects that have event handlers
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|