Hello!
I am having a problem with a windows application that abnormally terminates
itself. The application is a multi threaded .NET 1.1 application, and can
briefly be described as follows:
Call the thread running the GUI "A". When user clicks a button a new thread
"B" is created and started. "B" does a lots of work, among others transmitts
data via a USB-CAN-interface. At the end of "B" a paper label is printed
using methods provided by the framework
(System.Drawing.Printing.PrintDocument)
If I removes the printing routines no error occures, but when the printer is
enabled the application sometimes terminates. No error codes, no unhanlded
exceptions, no messages.
Does anyone have a clue what causes this problem?
Regards, Daniel 7 2569
Hi Daniel,
..NET Framework versions earlier than 2.0 swallow exceptions that occur on
background threads.
I suggest wrapping your printing code in a try..catch block. Read the
documentation for the printing methods that you use to determine which
exceptions may be thrown and catch the ones from which your application can
recover.
To aid in debugging, you may want to add a try..catch-all exception handler
that logs any exception and then rethrows them (even those exceptions not
being handled in your code).
--
Dave Sexton
"Daniel" <Da****@discussions.microsoft.comwrote in message
news:1B**********************************@microsof t.com...
Hello!
I am having a problem with a windows application that abnormally terminates
itself. The application is a multi threaded .NET 1.1 application, and can
briefly be described as follows:
Call the thread running the GUI "A". When user clicks a button a new thread
"B" is created and started. "B" does a lots of work, among others transmitts
data via a USB-CAN-interface. At the end of "B" a paper label is printed
using methods provided by the framework
(System.Drawing.Printing.PrintDocument)
If I removes the printing routines no error occures, but when the printer is
enabled the application sometimes terminates. No error codes, no unhanlded
exceptions, no messages.
Does anyone have a clue what causes this problem?
Regards, Daniel
Hello!
Thank you for a quick reply! Actually there are commonly no errors when
printing the label. Sometimes the error occures here, but not all the time.
Very often the error occures when user starts "B" agin.
I have try-catch blocks around my printing code, around the thread start
method and even around Main, no exceptions are thrown (At least no managed
exceptions). I also loggs all threads via Application.ThreadException and
Application.ThreadExit. As I can se, the printing thread (whicth is straed by
the framework) exits normally.
Another strange this is that in some cases the entire computer is
restarted...!
Daniel Carlson
"Dave Sexton" wrote:
Hi Daniel,
..NET Framework versions earlier than 2.0 swallow exceptions that occur on
background threads.
I suggest wrapping your printing code in a try..catch block. Read the
documentation for the printing methods that you use to determine which
exceptions may be thrown and catch the ones from which your application can
recover.
To aid in debugging, you may want to add a try..catch-all exception handler
that logs any exception and then rethrows them (even those exceptions not
being handled in your code).
--
Dave Sexton
"Daniel" <Da****@discussions.microsoft.comwrote in message
news:1B**********************************@microsof t.com...
Hello!
I am having a problem with a windows application that abnormally terminates
itself. The application is a multi threaded .NET 1.1 application, and can
briefly be described as follows:
Call the thread running the GUI "A". When user clicks a button a new thread
"B" is created and started. "B" does a lots of work, among others transmitts
data via a USB-CAN-interface. At the end of "B" a paper label is printed
using methods provided by the framework
(System.Drawing.Printing.PrintDocument)
If I removes the printing routines no error occures, but when the printer is
enabled the application sometimes terminates. No error codes, no unhanlded
exceptions, no messages.
Does anyone have a clue what causes this problem?
Regards, Daniel
Hi Daniel,
That does sound bad :|
Maybe it's a driver error.
The other thing I can recommend is to search the newsgroups and Microsoft's
knowledge base for problems like yours (if you haven't already) and then
solicit the help of Microsoft if that doesn't help you to solve the problem.
GL!
--
Dave Sexton
"Daniel" <Da****@discussions.microsoft.comwrote in message
news:A8**********************************@microsof t.com...
Hello!
Thank you for a quick reply! Actually there are commonly no errors when
printing the label. Sometimes the error occures here, but not all the time.
Very often the error occures when user starts "B" agin.
I have try-catch blocks around my printing code, around the thread start
method and even around Main, no exceptions are thrown (At least no managed
exceptions). I also loggs all threads via Application.ThreadException and
Application.ThreadExit. As I can se, the printing thread (whicth is straed
by
the framework) exits normally.
Another strange this is that in some cases the entire computer is
restarted...!
Daniel Carlson
"Dave Sexton" wrote:
>Hi Daniel,
..NET Framework versions earlier than 2.0 swallow exceptions that occur on background threads.
I suggest wrapping your printing code in a try..catch block. Read the documentation for the printing methods that you use to determine which exceptions may be thrown and catch the ones from which your application can recover.
To aid in debugging, you may want to add a try..catch-all exception handler that logs any exception and then rethrows them (even those exceptions not being handled in your code).
-- Dave Sexton
"Daniel" <Da****@discussions.microsoft.comwrote in message news:1B**********************************@microso ft.com...
Hello!
I am having a problem with a windows application that abnormally
terminates
itself. The application is a multi threaded .NET 1.1 application, and can
briefly be described as follows:
Call the thread running the GUI "A". When user clicks a button a new
thread
"B" is created and started. "B" does a lots of work, among others
transmitts
data via a USB-CAN-interface. At the end of "B" a paper label is printed
using methods provided by the framework
(System.Drawing.Printing.PrintDocument)
If I removes the printing routines no error occures, but when the printer
is
enabled the application sometimes terminates. No error codes, no
unhanlded
exceptions, no messages.
Does anyone have a clue what causes this problem?
Regards, Daniel
The framework 1.1 has an issue where it sometimes isnt ale to convert an
Access Violation into a .NET exception to throw and therefore the CLR is
terminate immediatly by windows without 1 more line of code running. I had
this for a long time with a data access rountine which would sometimes make
the application just dissappear like it was killed in task manager, I used to
have a link to the KB article about it but this was about 3 years ago now so
thats long gone.
Try handling System.Windows.Forms.Application.ThreadException event to see
if thats fired. Secondly, try running the thread inside a new app domain and
handling the unhandled exception event on the app domain from the form. It be
that the AppDomain is kill rather than the whole process.
I remember this one being a killer.
Ciaran O'Donnell
"Daniel" wrote:
Hello!
I am having a problem with a windows application that abnormally terminates
itself. The application is a multi threaded .NET 1.1 application, and can
briefly be described as follows:
Call the thread running the GUI "A". When user clicks a button a new thread
"B" is created and started. "B" does a lots of work, among others transmitts
data via a USB-CAN-interface. At the end of "B" a paper label is printed
using methods provided by the framework
(System.Drawing.Printing.PrintDocument)
If I removes the printing routines no error occures, but when the printer is
enabled the application sometimes terminates. No error codes, no unhanlded
exceptions, no messages.
Does anyone have a clue what causes this problem?
Regards, Daniel
Thank you for this post! This is the first post that is helpful to me! I have
search for infomration for over one week now...
I handle the System.Windows.Forms.Application.ThreadException event with no
result. No exceptions are thrown. I will try to run my application from
another domain and see what that gives.
A question though: Do you think this is solved in 2.0 of the framework? Or
at least give me a more stabel termination?
Daniel Carlson
"Ciaran O''Donnell" wrote:
The framework 1.1 has an issue where it sometimes isnt ale to convert an
Access Violation into a .NET exception to throw and therefore the CLR is
terminate immediatly by windows without 1 more line of code running. I had
this for a long time with a data access rountine which would sometimes make
the application just dissappear like it was killed in task manager, I used to
have a link to the KB article about it but this was about 3 years ago now so
thats long gone.
Try handling System.Windows.Forms.Application.ThreadException event to see
if thats fired. Secondly, try running the thread inside a new app domain and
handling the unhandled exception event on the app domain from the form. It be
that the AppDomain is kill rather than the whole process.
I remember this one being a killer.
Ciaran O'Donnell
"Daniel" wrote:
Hello!
I am having a problem with a windows application that abnormally terminates
itself. The application is a multi threaded .NET 1.1 application, and can
briefly be described as follows:
Call the thread running the GUI "A". When user clicks a button a new thread
"B" is created and started. "B" does a lots of work, among others transmitts
data via a USB-CAN-interface. At the end of "B" a paper label is printed
using methods provided by the framework
(System.Drawing.Printing.PrintDocument)
If I removes the printing routines no error occures, but when the printer is
enabled the application sometimes terminates. No error codes, no unhanlded
exceptions, no messages.
Does anyone have a clue what causes this problem?
Regards, Daniel
I have never had it happen on 2.0 and think I remember something about it
being sorted in 2.0. I have been building a big Winforms app in 2.0 for the
last year and it hasnt happened to me once.
Ciaran O'Donnell
"Daniel" wrote:
Thank you for this post! This is the first post that is helpful to me! I have
search for infomration for over one week now...
I handle the System.Windows.Forms.Application.ThreadException event with no
result. No exceptions are thrown. I will try to run my application from
another domain and see what that gives.
A question though: Do you think this is solved in 2.0 of the framework? Or
at least give me a more stabel termination?
Daniel Carlson
"Ciaran O''Donnell" wrote:
The framework 1.1 has an issue where it sometimes isnt ale to convert an
Access Violation into a .NET exception to throw and therefore the CLR is
terminate immediatly by windows without 1 more line of code running. I had
this for a long time with a data access rountine which would sometimes make
the application just dissappear like it was killed in task manager, I used to
have a link to the KB article about it but this was about 3 years ago now so
thats long gone.
Try handling System.Windows.Forms.Application.ThreadException event to see
if thats fired. Secondly, try running the thread inside a new app domain and
handling the unhandled exception event on the app domain from the form. It be
that the AppDomain is kill rather than the whole process.
I remember this one being a killer.
Ciaran O'Donnell
"Daniel" wrote:
Hello!
>
I am having a problem with a windows application that abnormally terminates
itself. The application is a multi threaded .NET 1.1 application, and can
briefly be described as follows:
>
Call the thread running the GUI "A". When user clicks a button a new thread
"B" is created and started. "B" does a lots of work, among others transmitts
data via a USB-CAN-interface. At the end of "B" a paper label is printed
using methods provided by the framework
(System.Drawing.Printing.PrintDocument)
>
If I removes the printing routines no error occures, but when the printer is
enabled the application sometimes terminates. No error codes, no unhanlded
exceptions, no messages.
>
Does anyone have a clue what causes this problem?
>
Regards, Daniel
I belive this is the article you requested... http://support.microsoft.com/kb/823140/
Daniel Carlson
"Ciaran O''Donnell" wrote:
I have never had it happen on 2.0 and think I remember something about it
being sorted in 2.0. I have been building a big Winforms app in 2.0 for the
last year and it hasnt happened to me once.
Ciaran O'Donnell
"Daniel" wrote:
Thank you for this post! This is the first post that is helpful to me! I have
search for infomration for over one week now...
I handle the System.Windows.Forms.Application.ThreadException event with no
result. No exceptions are thrown. I will try to run my application from
another domain and see what that gives.
A question though: Do you think this is solved in 2.0 of the framework? Or
at least give me a more stabel termination?
Daniel Carlson
"Ciaran O''Donnell" wrote:
The framework 1.1 has an issue where it sometimes isnt ale to convert an
Access Violation into a .NET exception to throw and therefore the CLR is
terminate immediatly by windows without 1 more line of code running. I had
this for a long time with a data access rountine which would sometimes make
the application just dissappear like it was killed in task manager, I used to
have a link to the KB article about it but this was about 3 years ago now so
thats long gone.
Try handling System.Windows.Forms.Application.ThreadException event to see
if thats fired. Secondly, try running the thread inside a new app domain and
handling the unhandled exception event on the app domain from the form. It be
that the AppDomain is kill rather than the whole process.
I remember this one being a killer.
>
Ciaran O'Donnell
>
>
>
>
"Daniel" wrote:
>
Hello!
I am having a problem with a windows application that abnormally terminates
itself. The application is a multi threaded .NET 1.1 application, and can
briefly be described as follows:
Call the thread running the GUI "A". When user clicks a button a new thread
"B" is created and started. "B" does a lots of work, among others transmitts
data via a USB-CAN-interface. At the end of "B" a paper label is printed
using methods provided by the framework
(System.Drawing.Printing.PrintDocument)
If I removes the printing routines no error occures, but when the printer is
enabled the application sometimes terminates. No error codes, no unhanlded
exceptions, no messages.
Does anyone have a clue what causes this problem?
Regards, Daniel
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: richardshen |
last post by:
My DB2 V8 SP5 WSE crash on Windows 2003 with the following msg in db2diag.log.
Any idea?
Looks like I need set stackreserver, what is the suggested value for that?
2004-03-05-12.20.46.299000 ...
|
by: RBarryYoung |
last post by:
How can I get the following two features in the same program in
VS2005?:
1) Access to the command-line arguments (cmdArgs()) that started my
App.
2) Shutdown Mode = "When last Form exits".
...
|
by: Bob |
last post by:
In Vs 2005 you have new applicationsEvents.vb I was testing it in a simple
app and found that it was easier to implement unhandled exception management
tah it was in Vs2003 (vb.net) You can, if you...
|
by: ponka128 |
last post by:
Hi,
I m in searching of solution from 1 week but still didn't find any solution of this problem.
I have made an MDI application in VB 6.0, which uses ActiveX object , Word , Excel , Regular...
|
by: teddysnips |
last post by:
One of my clients has asked me to make a change to one of their Access
applications.
The application is a Front End/Back End standard app. I didn't
develop it, but looking at it tells me that...
|
by: Jen |
last post by:
What is the most robust way to implement single-instancing for a Windows
app? I'm aware of the GetProcessByName method and the Mutex method. I've
GetProcessByName isn't very robust. What happens...
|
by: Peter Nimmo |
last post by:
Hi,
I am writting a windows application that I want to be able to act as if
it where a Console application in certain circumstances, such as error
logging.
Whilst I have nearly got it, it...
|
by: =?Utf-8?B?TWFya19C?= |
last post by:
I have a usb device that controls a power supply. That usb device must
perform a procedure, named Zero_outputs(), in the event of any error.
Clearly, within my main form (the only form in this...
|
by: Coffee Pot |
last post by:
Thanks for any advice.
~ CP
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |