M
Michael Lane
We have developed an application which performs a series of long tasks, so
in order to keep the GUI responsive we do these tasks in a separate thread.
When run from the development environment, or run as a standalone
application on any machine with VS 2003 installed, it is fine. On any other
machine, a exception is generated at a seemingly random time during
execution. The message box simply says "Application has generated an
exception which cannot be handled."
If we do not launch these processes in a separate thread (i.e call the
method directly), the problem disappears. The very simply code we use the
create the thread is as follows:
ThreadStart activeThreadStart = new ThreadStart(dataConversion);
activeThread = new Thread(activeThreadStart);
activeThread.Start();
We have attempted to trap this error to no avail, even going so far as to
use the following:
CustomExceptionHandler eh = new CustomExceptionHandler();
Application.ThreadException += new
ThreadExceptionEventHandler(eh.OnThreadException);
Application.Run(new SummaryForm());
All target machines have framework 1.1 and MDAC 2.8. If anyone has seen this
problem, or can suggest a cause or cure, that would be great.
Michael
in order to keep the GUI responsive we do these tasks in a separate thread.
When run from the development environment, or run as a standalone
application on any machine with VS 2003 installed, it is fine. On any other
machine, a exception is generated at a seemingly random time during
execution. The message box simply says "Application has generated an
exception which cannot be handled."
If we do not launch these processes in a separate thread (i.e call the
method directly), the problem disappears. The very simply code we use the
create the thread is as follows:
ThreadStart activeThreadStart = new ThreadStart(dataConversion);
activeThread = new Thread(activeThreadStart);
activeThread.Start();
We have attempted to trap this error to no avail, even going so far as to
use the following:
CustomExceptionHandler eh = new CustomExceptionHandler();
Application.ThreadException += new
ThreadExceptionEventHandler(eh.OnThreadException);
Application.Run(new SummaryForm());
All target machines have framework 1.1 and MDAC 2.8. If anyone has seen this
problem, or can suggest a cause or cure, that would be great.
Michael