Object reference not set to an instance of an object.

Topics related to the Krypton Toolkit.

Moderators: Phil Wright, Chris Porter

Object reference not set to an instance of an object.

Postby Nick71 » Fri Feb 25, 2011 2:52 am

Having upgraded from 4.2.0.0 to 4.3.1 I now get the error "Object reference not set to an instance of an object." when I call ShowDialog on my form. The stack trace is below...
Code: Select all
at ComponentFactory.Krypton.Toolkit.KryptonMaskedTextBox.InternalMaskedTextBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at ComponentFactory.Krypton.Toolkit.PI.RedrawWindow(IntPtr hWnd, IntPtr rectUpdate, IntPtr hRgnUpdate, UInt32 uFlags)
   at ComponentFactory.Krypton.Toolkit.VisualForm.InvalidateNonClient(Rectangle invalidRect, Boolean excludeClientArea)
   at ComponentFactory.Krypton.Toolkit.VisualForm.InvalidateNonClient()
   at ComponentFactory.Krypton.Toolkit.VisualForm.OnNeedPaint(Object sender, NeedLayoutEventArgs e)
   at ComponentFactory.Krypton.Toolkit.KryptonForm.OnWindowActiveChanged()
   at ComponentFactory.Krypton.Toolkit.VisualForm.set_WindowActive(Boolean value)
   at ComponentFactory.Krypton.Toolkit.VisualForm.OnWM_NCACTIVATE(Message& m)
   at ComponentFactory.Krypton.Toolkit.VisualForm.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   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.Control.set_Visible(Boolean value)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.RunDialog(Form form)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)


If I compile the source for 4.3.1, but replace the KryptonMaskedTextBox.cs with the version from 4.2.0.0 (there's just a couple of lines of code changed) it works fine, so appears a bug has been introduced here.
Nick71
 
Posts: 18
Joined: Fri Jan 15, 2010 11:52 pm
Location: Scotland, UK

Re: Object reference not set to an instance of an object.

Postby vulkanino » Fri Feb 25, 2011 6:36 pm

Did you UNINSTALL the old version before upgrading?
vulkanino
 
Posts: 110
Joined: Fri Oct 01, 2010 8:15 pm

Re: Object reference not set to an instance of an object.

Postby Nick71 » Mon Feb 28, 2011 9:57 pm

I did yes.
Nick71
 
Posts: 18
Joined: Fri Jan 15, 2010 11:52 pm
Location: Scotland, UK

Re: Object reference not set to an instance of an object.

Postby Phil Wright » Mon Mar 07, 2011 1:08 pm

I have made a change to the base code that I believe will fix this.
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia

Re: Object reference not set to an instance of an object.

Postby Nick71 » Tue Mar 08, 2011 11:43 pm

Thanks Phil. Is there any way I can try this, or do I need to wait for the next release?

Thanks
Nick
Nick71
 
Posts: 18
Joined: Fri Jan 15, 2010 11:52 pm
Location: Scotland, UK

Re: Object reference not set to an instance of an object.

Postby Phil Wright » Wed Mar 09, 2011 11:40 am

Here is the modified source code file for just the KryptonMaskedTextBox

http://www.componentfactory.com/downloa ... TextBox.cs
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia

Re: Object reference not set to an instance of an object.

Postby Nick71 » Thu Mar 10, 2011 1:22 am

Problem solved. Thanks Phil.
Nick71
 
Posts: 18
Joined: Fri Jan 15, 2010 11:52 pm
Location: Scotland, UK

Re: Object reference not set to an instance of an object.

Postby spencerberus » Fri Mar 11, 2011 6:58 am

I am having the same problem, and am using the free Toolkit in an open source project, so don't think I have access to the source code (I don't see it with the installation, at least). Is it possible to get this fix in a compiled version of the Toolkit?
spencerberus
 
Posts: 2
Joined: Thu Nov 19, 2009 9:55 am

Re: Object reference not set to an instance of an object.

Postby Phil Wright » Fri Mar 11, 2011 3:19 pm

Sorry, but you will need to wait until the next release to get the set of bug fixes.
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia

Re: Object reference not set to an instance of an object.

Postby robains » Fri Apr 01, 2011 7:41 am

I'm having this problem also. Oddly only when installed on a Windows 2008 Server ... don't have this problem on my development PC (Vista x64).

System.NullReferenceException: Object reference not set to an instance of an object.
at ComponentFactory.Krypton.Toolkit.KryptonMaskedTextBox.InternalMaskedTextBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Any word on when we'll get a new update from 4.3.1 to 4.3.2?

Thanks, Rob.
robains
 
Posts: 80
Joined: Tue May 13, 2008 2:27 am
Location: CA


Return to Krypton Toolkit

Who is online

Users browsing this forum: Google [Bot] and 0 guests