Description
When using MyStatus I get the following OverflowException:
************** Exception Text **************
System.OverflowException: Value was either too large or too small for an Int32.
at System.Convert.ToInt32(Double value)
at System.Convert.ToInt16(Double value)
at MediaPortal.GUI.GUIStatus.GUIStatus.UpdateFields() in f:\Scratch\mediaportal\WindowPlugins\GUIStatus\GUIStatus.cs:line 508
at MediaPortal.GUI.GUIStatus.GUIStatus.OnTimer(Object sender, EventArgs e) in f:\Scratch\mediaportal\WindowPlugins\GUIStatus\GUIStatus.cs:line 304
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)
The previous version of MyStatus worked just fine.
I had the debugger break on the exception and noted down the values.
p=Convert.ToInt16(act/(max/100)); <-- The line where it goes wrong (508)
act = 2666.0
max = 0.0
BTW: 2666 is my CPU speed, maybe it helps with locating the problem.
BTW2: Problem is gone when I uncheck the checkbox with the MHz caption
************** Exception Text **************
System.OverflowException: Value was either too large or too small for an Int32.
at System.Convert.ToInt32(Double value)
at System.Convert.ToInt16(Double value)
at MediaPortal.GUI.GUIStatus.GUIStatus.UpdateFields() in f:\Scratch\mediaportal\WindowPlugins\GUIStatus\GUIStatus.cs:line 508
at MediaPortal.GUI.GUIStatus.GUIStatus.OnTimer(Object sender, EventArgs e) in f:\Scratch\mediaportal\WindowPlugins\GUIStatus\GUIStatus.cs:line 304
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)
The previous version of MyStatus worked just fine.
I had the debugger break on the exception and noted down the values.
p=Convert.ToInt16(act/(max/100)); <-- The line where it goes wrong (508)
act = 2666.0
max = 0.0
BTW: 2666 is my CPU speed, maybe it helps with locating the problem.
BTW2: Problem is gone when I uncheck the checkbox with the MHz caption