G
Guest
Sorry for reposting here but I apparantly managed to pick the wrong
discussion group earlier. Here's my story:
Hi all,
I am developping a simple application that displays an animated weather .gif
in a picturebox. Besides the picturebox there are only a few labels on the
form. The form is called from a module.
The .gif is loaded from the internet via
PictureBox1.ImageLocation = [URL string to image]
and is reloaded every 10 minutes.
Things that I observe:
1) The application NEVER crashes in the IDE running on Windows XP
2) The compiled application DOES crash on all 3 different XP test computers,
including the one that hosts VS 2005 and that is used to develop the app.
Often it crashes repeatedly immediately after starting the program, often
only after a few hours. The program never was able to run for 24 hours.
3) The application NEVER crashes on Windows Vista.
If I deactivate the part that loads the image, the program never crashes, so
I am sure the picturebox is the culprit.
After some Googling on this subject, I tried to replace
PictureBox1.ImageLocation = [URL string to image]
by
Dim WebClient As New System.Net.WebClient
Dim bytes() As Byte = WebClient.DownloadData([URL string to image])
Dim Stream As New IO.MemoryStream(bytes)
PictureBox1.Image = New System.Drawing.Bitmap(Stream)
Unfortunately, that didn't improve much. I do notice, however, that when
adding
Stream.Close
the application DOES crash in the IDE, however the error ignores the
Try..Catch in the Sub that contains the above and is only caught by the Catch
in the Module that loads the Form. If I remove Stream.Close, the app does
crash on XP (but not in the IDE) and not on Vista, just as before.
If the program crashes, the familiar GDI+ error box is shown, without really
much help on what is going on. Most of the times, the PictureBox is replaced
by a white background and a red cross and eventually the labels on the form
are replaced by those red crosses as well. Sometimes it starts with crossing
the labels instead, however. Often even the buttons on the GDI+ error window
get these red crosses(?!).
Does anyone know what is going on here? Thanks in advance!
discussion group earlier. Here's my story:
Hi all,
I am developping a simple application that displays an animated weather .gif
in a picturebox. Besides the picturebox there are only a few labels on the
form. The form is called from a module.
The .gif is loaded from the internet via
PictureBox1.ImageLocation = [URL string to image]
and is reloaded every 10 minutes.
Things that I observe:
1) The application NEVER crashes in the IDE running on Windows XP
2) The compiled application DOES crash on all 3 different XP test computers,
including the one that hosts VS 2005 and that is used to develop the app.
Often it crashes repeatedly immediately after starting the program, often
only after a few hours. The program never was able to run for 24 hours.
3) The application NEVER crashes on Windows Vista.
If I deactivate the part that loads the image, the program never crashes, so
I am sure the picturebox is the culprit.
After some Googling on this subject, I tried to replace
PictureBox1.ImageLocation = [URL string to image]
by
Dim WebClient As New System.Net.WebClient
Dim bytes() As Byte = WebClient.DownloadData([URL string to image])
Dim Stream As New IO.MemoryStream(bytes)
PictureBox1.Image = New System.Drawing.Bitmap(Stream)
Unfortunately, that didn't improve much. I do notice, however, that when
adding
Stream.Close
the application DOES crash in the IDE, however the error ignores the
Try..Catch in the Sub that contains the above and is only caught by the Catch
in the Module that loads the Form. If I remove Stream.Close, the app does
crash on XP (but not in the IDE) and not on Vista, just as before.
If the program crashes, the familiar GDI+ error box is shown, without really
much help on what is going on. Most of the times, the PictureBox is replaced
by a white background and a red cross and eventually the labels on the form
are replaced by those red crosses as well. Sometimes it starts with crossing
the labels instead, however. Often even the buttons on the GDI+ error window
get these red crosses(?!).
Does anyone know what is going on here? Thanks in advance!