Threading passing parameters to thread
-
I Have a function that takes arguments and process and return a dataset (the scenario is working fine), Now i need to put my function in thread but unable to find any way to pass arguments to thread and take return argument from thread. Totally clueless to threads, Please Help!!!! Thank you! M. Nauman Yousuf
"Mess with the Best, Die like the rest"
-
I Have a function that takes arguments and process and return a dataset (the scenario is working fine), Now i need to put my function in thread but unable to find any way to pass arguments to thread and take return argument from thread. Totally clueless to threads, Please Help!!!! Thank you! M. Nauman Yousuf
"Mess with the Best, Die like the rest"
Hi, have a look at the BackgroundWorker class, that is intended for such situations. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
I Have a function that takes arguments and process and return a dataset (the scenario is working fine), Now i need to put my function in thread but unable to find any way to pass arguments to thread and take return argument from thread. Totally clueless to threads, Please Help!!!! Thank you! M. Nauman Yousuf
"Mess with the Best, Die like the rest"
if you are using framework 2 then i think there is some thing called parametrize thread. if you are using frame work 1.1 then have a function in a different class which doesnt take any parameter but use class level variabe in that class pass the parameter through constructor and and in the method use those mvariable. and call that method using thread.
-
Hi, have a look at the BackgroundWorker class, that is intended for such situations. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
I will look in to it, thx Luc Pattyn
"Mess with the Best, Die like the rest"