Threading issue.. 
Author Message
 Threading issue..

I have an application that downloads web pages, then runs through thte code
of the webpage and displays the output onto a form.  The download procedure
freezes up the form unfortunatly so I wanted to run the download code in a
different thread.. only that code runs the display code.  I get the error
that one thread cannot edit controls on another thread any idea for a
solution?


Tue, 06 Dec 2005 14:10:58 GMT  
 Threading issue..
You should never access a control except from the thread that created that
control. Use Control.InvokeRequired to check whether you're on the right
thread. If that returns true, you need to use Control.Invoke to get onto the
correct thread before updating the control.

HTH,

Mark
--
Author of "Comprehensive VB .NET Debugging"
http://www.apress.com/book/bookDisplay.html?bID=128


I have an application that downloads web pages, then runs through thte code
of the webpage and displays the output onto a form.  The download procedure
freezes up the form unfortunatly so I wanted to run the download code in a
different thread.. only that code runs the display code.  I get the error
that one thread cannot edit controls on another thread any idea for a
solution?



Tue, 06 Dec 2005 15:19:17 GMT  
 Threading issue..
Hello,


Quote:
> I have an application that downloads web pages, then runs
> through thte code of the webpage and displays the output
> onto a form.  The download procedure freezes up the form
> unfortunatly so I wanted to run the download code in a
> different thread..

Sample written in C#:

http://www.codeproject.com/csharp/WebDownload.asp

Regards,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet



Tue, 06 Dec 2005 15:23:35 GMT  
 Threading issue..
Hello,


Quote:
> different thread.. only that code runs the display code.  I
> get the error that one thread cannot edit controls on another
> thread any idea for a solution?

Article on multithreading + windows forms:

http://www.devx.com/dotnet/Article/11358

Regards,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet



Tue, 06 Dec 2005 15:24:51 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Seeking advice on threading issues

2. VB Threading issue

3. DLL Threading Issue

4. Threading Issues with VB6

5. multi-threaded issue?

6. VB Com and Threading issues

7. Object creation problem - concurrency/threading issue??

8. Threading Issues

9. OCX Problem with Multi-threaded Issue

10. Is there an issue with Suspended threads leaking?

11. Synchronization issue - Threading (volatile keyword)

12. VB Threads vs. Timers Design Issue

 

 
Powered by phpBB® Forum Software