I have an application that I am developing that will process files based on a database table.
Currently I'm developing my solution with multiple projects in VS 2008. I have 1 project for the base class with all of the processing code in it. Then I have 2 more projects (1 for a thick-app and 1 for a service).
The base class has the ability to process multiple items (1 at a time) before finishing the routine and returning to the service or thick app. Unfortunately a plugin I'm using does not have the ability to work as multithreaded and I have to process 1 item at a time.
I'm trying to add multithreading support to the base class so that I can have the thick-app update a progress bar to let a user know how far along it is through its queue of items to process.
I've done some testing and got the multithreading to work in the thick app for updating a text box and progress bar. I'm using a call to control.Invoke to update the properties of the control successfully. The data I want to use to update it with needs to come from the separate class.
Here are my questions/hangups so far:
1. How to get the separate class to update the UI from the class itself.
2. How to use a backgroundworker in the UI to link to a backgroundworker in the separate class.
3. How to use the ReportProgress from the separate class back to the UI for the user to see.
4. How to keep my code for processing the items in the separate class as opposed to moving the code to the UI. I would prefer to only have 1 codebase.
Any assistance that can be provided would be very helpful.
Thanks,
Josh
Currently I'm developing my solution with multiple projects in VS 2008. I have 1 project for the base class with all of the processing code in it. Then I have 2 more projects (1 for a thick-app and 1 for a service).
The base class has the ability to process multiple items (1 at a time) before finishing the routine and returning to the service or thick app. Unfortunately a plugin I'm using does not have the ability to work as multithreaded and I have to process 1 item at a time.
I'm trying to add multithreading support to the base class so that I can have the thick-app update a progress bar to let a user know how far along it is through its queue of items to process.
I've done some testing and got the multithreading to work in the thick app for updating a text box and progress bar. I'm using a call to control.Invoke to update the properties of the control successfully. The data I want to use to update it with needs to come from the separate class.
Here are my questions/hangups so far:
1. How to get the separate class to update the UI from the class itself.
2. How to use a backgroundworker in the UI to link to a backgroundworker in the separate class.
3. How to use the ReportProgress from the separate class back to the UI for the user to see.
4. How to keep my code for processing the items in the separate class as opposed to moving the code to the UI. I would prefer to only have 1 codebase.
Any assistance that can be provided would be very helpful.
Thanks,
Josh