i have an application that downloads lots of images at the same time..... to do this i create a seperate thread for each image i want to download. each thread calls the following procedure (public procedure in a module)
Dim theRequest As System.Net.WebRequest = System.Net.WebRequest.Create(url)
Dim theResponse As System.Net.WebResponse = theRequest.GetResponse()
Dim theImage As System.Drawing.Image = System.Drawing.Image.FromStream(theResponse.GetResponseStream())
sometimes it will lock the application up and it will fail on therequest.GetResponse
System.AccessViolationException was unhandled
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
so i went back and made the app only download 1 image at a time and it works just fine
why can't i call this 5 or 10 times at the same time.. in different threads?
Dim theRequest As System.Net.WebRequest = System.Net.WebRequest.Create(url)
Dim theResponse As System.Net.WebResponse = theRequest.GetResponse()
Dim theImage As System.Drawing.Image = System.Drawing.Image.FromStream(theResponse.GetResponseStream())
sometimes it will lock the application up and it will fail on therequest.GetResponse
System.AccessViolationException was unhandled
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
so i went back and made the app only download 1 image at a time and it works just fine
why can't i call this 5 or 10 times at the same time.. in different threads?