Unhandled Exception about emSize
Posted: Thu May 08, 2008 12:22 pm
Hi,
I'm using the latest version of TeeChart .Net 2: V.2.0.3033.18431. The problem is that I obtain an unhandled Exception when I want update my Teechart control and I can't handle this exception to fix de problem.
Here the complete situation:
This application contain 2 Steema.TeeChart.TChart control in 2 differents System.Windows.Forms.TabPage. This application is "connected" with .Net remoting to a server application. The server application post an "Event" with new data, and I refresh my TChart control. My application is build with VB.Net 2005.
I minimize my application, I wait few minutes and next I maximize my application. I select the TapPage that contain my TChart control, I update my TChart control with new data and a error dialogBox appear with this message:
An unhandled exception of type 'System.ArgumentException' occured in System.Drawing.dll.
Additionnal information: Value of '0' is not valid for 'emSize'. 'emSize' should be greater than 0 and less than or equal to System.Single.MaxValue.
Next, I obtain a BIG RED X in my TChart control, and my application die.
Here, all information give by JIT debugger:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentException: Value of '0' is not valid for 'emSize'. 'emSize' should be greater than 0 and less than or equal to System.Single.MaxValue.
Parameter name: emSize
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style)
at Steema.TeeChart.Drawing.ChartFont.get_DrawingFont()
at Steema.TeeChart.Drawing.Graphics3DGdiPlus.MeasureString(ChartFont f, String text)
at Steema.TeeChart.Drawing.Graphics3D.TextHeight(ChartFont f, String text)
at Steema.TeeChart.Drawing.Graphics3D.FontTextHeight(ChartFont f)
at Steema.TeeChart.Axis.InternalCalcSize(ChartFont tmpFont, Int32 tmpAngle, String tmpText, Int32 tmpSize)
at Steema.TeeChart.Axis.CalcRect(Rectangle& r, Boolean inflateChartRectangle)
at Steema.TeeChart.Chart.AxisRect(Axis a, Rectangle& r)
at Steema.TeeChart.Chart.CalcAxisRect()
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
at Steema.TeeChart.Chart.InternalDraw(Graphics g)
at Steema.TeeChart.TChart.Draw(Graphics g)
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.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)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
EF60
Assembly Version: 2.0.1.0
Win32 Version: 2.0.1.0
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/EF60.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
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.1433 (REDBITS.050727-1400)
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.1433 (REDBITS.050727-1400)
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.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
TeeChart
Assembly Version: 2.0.3033.18431
Win32 Version: 2.0.3033.18431
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/TeeChart.DLL
----------------------------------------
CMQCLogger
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/CMQCLogger.DLL
----------------------------------------
CMQCLOGDOTNET
Assembly Version: 1.1.2880.26385
Win32 Version: 1.1.2880.26385
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/CMQCLOGDOTNET.DLL
----------------------------------------
I_CMQCComm
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/I_CMQCComm.DLL
----------------------------------------
Microsoft.VisualBasic.Compatibility
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic.Compatibility/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.Compatibility.dll
----------------------------------------
System.Web.Services
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
r6sunxd-
Assembly Version: 2.0.1.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Microsoft.JScript
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.JScript/8.0.0.0__b03f5f7f11d50a3a/Microsoft.JScript.dll
----------------------------------------
System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
PI
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/PI.DLL
----------------------------------------
System.Deployment
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.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.
I appreciate if anyone know the solution of my problem.
Thanks!
I'm using the latest version of TeeChart .Net 2: V.2.0.3033.18431. The problem is that I obtain an unhandled Exception when I want update my Teechart control and I can't handle this exception to fix de problem.
Here the complete situation:
This application contain 2 Steema.TeeChart.TChart control in 2 differents System.Windows.Forms.TabPage. This application is "connected" with .Net remoting to a server application. The server application post an "Event" with new data, and I refresh my TChart control. My application is build with VB.Net 2005.
I minimize my application, I wait few minutes and next I maximize my application. I select the TapPage that contain my TChart control, I update my TChart control with new data and a error dialogBox appear with this message:
An unhandled exception of type 'System.ArgumentException' occured in System.Drawing.dll.
Additionnal information: Value of '0' is not valid for 'emSize'. 'emSize' should be greater than 0 and less than or equal to System.Single.MaxValue.
Next, I obtain a BIG RED X in my TChart control, and my application die.
Here, all information give by JIT debugger:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentException: Value of '0' is not valid for 'emSize'. 'emSize' should be greater than 0 and less than or equal to System.Single.MaxValue.
Parameter name: emSize
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style)
at Steema.TeeChart.Drawing.ChartFont.get_DrawingFont()
at Steema.TeeChart.Drawing.Graphics3DGdiPlus.MeasureString(ChartFont f, String text)
at Steema.TeeChart.Drawing.Graphics3D.TextHeight(ChartFont f, String text)
at Steema.TeeChart.Drawing.Graphics3D.FontTextHeight(ChartFont f)
at Steema.TeeChart.Axis.InternalCalcSize(ChartFont tmpFont, Int32 tmpAngle, String tmpText, Int32 tmpSize)
at Steema.TeeChart.Axis.CalcRect(Rectangle& r, Boolean inflateChartRectangle)
at Steema.TeeChart.Chart.AxisRect(Axis a, Rectangle& r)
at Steema.TeeChart.Chart.CalcAxisRect()
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
at Steema.TeeChart.Chart.InternalDraw(Graphics g)
at Steema.TeeChart.TChart.Draw(Graphics g)
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.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)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
EF60
Assembly Version: 2.0.1.0
Win32 Version: 2.0.1.0
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/EF60.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
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.1433 (REDBITS.050727-1400)
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.1433 (REDBITS.050727-1400)
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.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
TeeChart
Assembly Version: 2.0.3033.18431
Win32 Version: 2.0.3033.18431
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/TeeChart.DLL
----------------------------------------
CMQCLogger
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/CMQCLogger.DLL
----------------------------------------
CMQCLOGDOTNET
Assembly Version: 1.1.2880.26385
Win32 Version: 1.1.2880.26385
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/CMQCLOGDOTNET.DLL
----------------------------------------
I_CMQCComm
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/I_CMQCComm.DLL
----------------------------------------
Microsoft.VisualBasic.Compatibility
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic.Compatibility/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.Compatibility.dll
----------------------------------------
System.Web.Services
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
r6sunxd-
Assembly Version: 2.0.1.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Microsoft.JScript
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.JScript/8.0.0.0__b03f5f7f11d50a3a/Microsoft.JScript.dll
----------------------------------------
System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
PI
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///D:/PROJET/PROD/DEV/EFXX/Trafic%202007/EF60/bin/Debug/PI.DLL
----------------------------------------
System.Deployment
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.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.
I appreciate if anyone know the solution of my problem.
Thanks!