Greetings.
I've been researching this topic quite some time now, and haven't been able to figure it out at all.
Basically I have a Windows Forms C# (Visual Studio 2008 Express) application, that has two classes which make HttpWebRequests, which hang the whole application during the request.
What I would need to do is to allow the classes make the HttpWebRequests asycnhronously. The incoming data is parsed by a different function that takes parameters, but which is still inside the class. This function then calls the parent Windows Forms and adds a message to a TextBox.
I understand that adding text to a TextBox from two classes which are on separate threads can cause problems easily.
Any help is much appreciated. I've been stuck with similar problems for years now.
- Sam
Loading
Sam HobbsPosted Apr 1, 2010, 11:08 PM
There are a few articles in this web site about threading; do they not help?
SamPosted Apr 1, 2010, 5:50 AM
I think I know how to make asynchronous HttpWebRequests but they operate on a function that needs to call another function. I understand this can be a problem.
Also, what would be the best way to make a whole object (class) into its own thread, one that would only sometimes call the original Windows Forms and pass text string as a parameter so the Forms can write it into a TextBox?
Thank you.
Sam HobbsPosted Mar 31, 2010, 11:42 AM