Major problem with uknown exceptions!

P

pnp

Hi all,
I have developed an app in C# and I have used some of the Infragistics
components in it. The problem is that while one is playing with the
windows within the mdi container exceptions occur that are not being
handled by any Exception handler. I have also placed one after the
application run method so if any exception occurs this "sink" will catch
it. But instead an error occurs from an unhandled exception and the
application closes. Any Ideas? The problem is very large since in about
10 minutes of use such an exception occurs. The problem uses a SQL
Server database and stores information about ones contacts.


The errors that occur are:

*****************************************************

System.NullReferenceException: Object reference not set to an instance
of an object.
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd,
Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at FE.BasicElements.MsgBox..ctor(String Title, String Description,
MsgBoxButtons Buttons, MsgBoxIcon DisplayIcon) in ...
-----------------------------------------------------

System.NullReferenceException: Object reference not set to an instance
of an object.
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.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at System.Windows.Forms.ThreadContext.OnThreadException(Exception t)
at System.Windows.Forms.Control.WndProcException(Exception e)
at
System.Windows.Forms.ControlNativeWindow.OnThreadException(Exception e)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
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 FE.MainFrame.LoginScreen.Main())
-----------------------------------------------------

How can I handle these errors so that my app won't close abruptly?

Thanks in advance,
Peter
 
T

Timofey Kazakov

Hello, "pnp"
I have developed an app in C# and I have used some of the Infragistics
components in it. The problem is that while one is playing with the
windows within the mdi container exceptions occur that are not being
handled by any Exception handler. I have also placed one after the
application run method so if any exception occurs this "sink" will catch
it. But instead an error occurs from an unhandled exception and the
application closes. Any Ideas? The problem is very large since in about
10 minutes of use such an exception occurs. The problem uses a SQL
Server database and stores information about ones contacts.
Are you dispatch Application.ThreadException event?
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

NullReferenceException occur when you access a method,property, etc from an
instance that is null , if you find the instance that is null and either
prevent it or handle it you solve it.
As you are using a third party component it may be possible that it's that
code and not yours where the problem is.

I assume that what you posted below is Exception.StackTrace as it does not
has line numbers it may comes from the third party control, unless you are
compiling it in release and not in debug.

Have you try to contact Infragistics about this?

Cheers,
 
P

pnp

Even if I catch the error there than the app will still
close after it has been handled or in the best case I will
run it again manually.

While all the objects that are being used have already been
initialized, they created the error that you can see on my
previous message from the stacktrace. They are saying
something about a null object where there is none.

Am I missing something?
 

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