System.NullReferenceException

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My application goes down with this exception:
System.NullReferenceException:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ELIPSON.Form1.Main(String[] arg) in
d:\projekty\aplikacje\csharp\elipson\elipson\form1.cs:line 1974

I need some help on this.
 
check file if there're any object with null value
d:\projekty\aplikacje\csharp\elipson\elipson\form1.cs:line 1974

General approach is to use the debugger and watch for the value of variables
you're using....

This exception occurs when your calling on object who's value is null.

MyClass class1;

class1.Method(); //null reference exception

MyClass class2 = new MyClass(...);
class2.Method();//rund okay
 
At that line:
d:\projekty\aplikacje\csharp\elipson\elipson\form1.cs:line 1974
is Application.Run(new MyObject());
in main function;

Vadym Stetsyak said:
check file if there're any object with null value
d:\projekty\aplikacje\csharp\elipson\elipson\form1.cs:line 1974

General approach is to use the debugger and watch for the value of variables
you're using....

This exception occurs when your calling on object who's value is null.

MyClass class1;

class1.Method(); //null reference exception

MyClass class2 = new MyClass(...);
class2.Method();//rund okay

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

Robson said:
My application goes down with this exception:
System.NullReferenceException:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ELIPSON.Form1.Main(String[] arg) in
d:\projekty\aplikacje\csharp\elipson\elipson\form1.cs:line 1974

I need some help on this.
 
post the code of my MyObject contructor class

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

Robson said:
At that line:
d:\projekty\aplikacje\csharp\elipson\elipson\form1.cs:line 1974
is Application.Run(new MyObject());
in main function;

Vadym Stetsyak said:
check file if there're any object with null value
d:\projekty\aplikacje\csharp\elipson\elipson\form1.cs:line 1974

General approach is to use the debugger and watch for the value of
variables
you're using....

This exception occurs when your calling on object who's value is null.

MyClass class1;

class1.Method(); //null reference exception

MyClass class2 = new MyClass(...);
class2.Method();//rund okay

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

Robson said:
My application goes down with this exception:
System.NullReferenceException:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32
reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ELIPSON.Form1.Main(String[] arg) in
d:\projekty\aplikacje\csharp\elipson\elipson\form1.cs:line 1974

I need some help on this.
 
Back
Top