Help with cause of error please

  • Thread starter Thread starter harry
  • Start date Start date
H

harry

Hi

This error appears from time to time either when my VB.NET program starts or
at some time during runtime. It is absolutely inconsistent. I change nothing
in my code and yet after I restart the program the error may or may not
appear again until some unknopwn future time. Sometimes the error doesn't
appear for days, other times it appears often in 1 day. It is very strange.

///
An unhandled exception of type 'System.NullReferenceException' occurred in
system.windows.forms.dll

Additional information: Object reference not set to an instance of an
object.
///

Public Class frmMain <<<<<< this line triggers the error
Inherits System.Windows.Forms.Form


Could someone give me a link or idea on how to trap this error so that I may
get more detailed explanation of it's cause. If the error was triggered in a
sub/function I can trap with try/catch, however how do I catch unhandled
errors in the entire class?

Thanks
Harry
 
Hi,

Hard to say what is causing the error without seeing your code.

Ken
----------------
 
harry said:
Hi

This error appears from time to time either when my VB.NET program
starts or at some time during runtime. It is absolutely inconsistent.
I change nothing in my code and yet after I restart the program the
error may or may not appear again until some unknopwn future time.
Sometimes the error doesn't appear for days, other times it appears
often in 1 day. It is very strange.

///
An unhandled exception of type 'System.NullReferenceException'
occurred in system.windows.forms.dll

Additional information: Object reference not set to an instance of
an object.
///

Public Class frmMain <<<<<< this line triggers the error
Inherits System.Windows.Forms.Form


Could someone give me a link or idea on how to trap this error so
that I may get more detailed explanation of it's cause. If the error
was triggered in a sub/function I can trap with try/catch, however
how do I catch unhandled errors in the entire class?

Post the callstack when the error occurs.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Back
Top