System.NullReferenceException

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.
 
V

Vadym Stetsyak

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
 
G

Guest

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.
 
V

Vadym Stetsyak

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top