Click here to Skip to main content
15,846,211 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Backgroundworker which implements Downloading a file function in separate thread. The download function is written in another class which has file path as argument. I need to report the progress using Backgroundworker class. Is there any way to report the progress without passing the object of Backgroundworker class as argument?
Updated 7-Feb-10 23:03pm

Would you please elaborate more on this, what I think I understood so far is that your problem is not in the Background Worker, its actually in the way you are using it.

If you elaborate more we might give you a proper answer.
Share this answer
MSDN[^] help is having a sample application which deals with the progress.
Share this answer
The code that actually does the download must implement progress reporting, probably by publishing an event just like the BackgroundWorker class. Your BackgroundWorker instance should subscribe to this event and call its own ReportProgress method, bubbling the event up to your client code.

The code that does the download should not know about BackgroundWorker as it has nothing to do with the download.

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900