Author Topic: ALARM Error  (Read 3667 times)

ms352

  • Newbie
  • *
  • Posts: 1
ALARM Error
« on: November 11, 2018, 05:54:15 PM »
Hi,
Just downloaded CTC. Running Windows 7 have Net2.0.

Get the following error when hitting the ALARM button during any simulation:


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at b8.d(Object A_0, EventArgs A_1)
   at System.Windows.Forms.Control.OnResize(EventArgs e)
   at System.Windows.Forms.Form.OnResize(EventArgs e)
   at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at System.Windows.Forms.Form.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at System.Windows.Forms.Control.ScaleControl(SizeF factor, BoundsSpecified specified)
   at System.Windows.Forms.ScrollableControl.ScaleControl(SizeF factor, BoundsSpecified specified)
   at System.Windows.Forms.Form.ScaleControl(SizeF factor, BoundsSpecified specified)
   at System.Windows.Forms.Control.ScaleControl(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
   at System.Windows.Forms.ContainerControl.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
   at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean includedBounds, Boolean excludedBounds)
   at System.Windows.Forms.ContainerControl.OnLayoutResuming(Boolean performLayout)
   at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
   at b8.a()
   at b8..ctor()
   at ff.b()
   at j8.a(Form A_0, a A_1)
   at ff.n(Object A_0, EventArgs A_1)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(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)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
ctc
    Assembly Version: 4.6.0.0
    Win32 Version: 4.6.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/WebRailRoader/CTC/ctc.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5460 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5462 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Any help would be appreciated.

Thanks,
-Mike

DPump

  • Administrator
  • Full Member
  • *****
  • Posts: 215
Re: ALARM Error
« Reply #1 on: November 11, 2018, 06:04:25 PM »
Thanks for the report - will work on it tomorrow.

DPump

  • Administrator
  • Full Member
  • *****
  • Posts: 215
Re: ALARM Error
« Reply #2 on: November 12, 2018, 08:52:16 AM »
Well, it looks like that the resize event is triggered before the load event is completed, which sets up a variable needed for the resize to work. That's the only explanation that makes sense - and who knows what surprises are in store when dealing with the intricacies of interfacing with the operating system.

I haven't seen it myself (in my environment the resize event is not triggered during the load!), so I have to rely on somebody reporting that to me. Thank you for that!

One thing you can try is to allow the program to continue. Exceptions sometimes give you the option to abort the program or try to ignore that problem - see what happens. Worst thing you get it again or program gets stuck and you have to abort the program by other means.

The NullReferenceException, though, can easily be avoided programmatically, so that's I'm going to do for the next upcoming release of CTC. Because of the exception issue the release will be rather sooner than later.

EdgardBel

  • Newbie
  • *
  • Posts: 1
Re: ALARM Error
« Reply #3 on: December 14, 2018, 05:38:39 AM »
Is the new release with the fix for this out, DPump? I've had this issue happen to me too and letting the program just run doesn't seem to do anything.

DPump

  • Administrator
  • Full Member
  • *****
  • Posts: 215
Re: ALARM Error
« Reply #4 on: December 14, 2018, 06:56:37 AM »
It should be. I could not reproduce this error, but the error trace suggests to add a defensive check would be prudent. It is the last item listed in the announcement of CTC Release 4.7.