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!
Unhandled Exception about emSize
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Youlrik,
It would be very helpful if you could arrange a simple example project we can run "as-is" to reproduce the problem here. A test datasource could be easily created as in the example Christopher Ireland posted here.
You can either post your files at news:/www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
It would be very helpful if you could arrange a simple example project we can run "as-is" to reproduce the problem here. A test datasource could be easily created as in the example Christopher Ireland posted here.
You can either post your files at news:/www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Light version with my problem
Hi Narìs,
I put a light version of my application on your UpLoad page. The name is EF60.zip. To Simulate my server, I put a basic Timer that start refresh my TChart control.
To reproduce the problem:
1. Start application;
2. Wait 5 seconds;
3. Minimize the application;
4. Wait 20 seconds;
5. Maximize the application;
6. Select "Concentrateur" tabPage;
7. See the error dialogBox.
If you need more information, feel free to contact me.
I put a light version of my application on your UpLoad page. The name is EF60.zip. To Simulate my server, I put a basic Timer that start refresh my TChart control.
To reproduce the problem:
1. Start application;
2. Wait 5 seconds;
3. Minimize the application;
4. Wait 20 seconds;
5. Maximize the application;
6. Select "Concentrateur" tabPage;
7. See the error dialogBox.
If you need more information, feel free to contact me.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Youlrik,
Thanks for the example project. We could reproduce the issue here but can't find the cause of the error. Could you please try reproducing the issue without using threading?
Thanks in advance.
Thanks for the example project. We could reproduce the issue here but can't find the cause of the error. Could you please try reproducing the issue without using threading?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
My problem is about me.Size.Height
Hi,
I think I found the problem. I use "Me.Size.Height" to ajust all fonts in my TChart control. When I minimize my Form, the value of "Me.Size.Height" is equal to 31. And 5*31/100 equal 0 for an integer(see below). To correcte the problem I use Max(val1,val2) function. With that I'm sure the value is not 0. I Give you in your upload page a very light version with my problem, if you need more information.
Bad code
If TypeOf (Me.poTChart1.Series(i)) Is Styles.Points3D Then
With DirectCast(Me.poTChart1.Series(i), Styles.Points3D).Pointer
.VertSize = 5 * Me.Size.Height / 1000, 5)
.HorizSize = 5 * Me.Size.Height / 1000, 5)
End With
End If
Solution that correct the problem
If TypeOf (Me.poTChart1.Series(i)) Is Styles.Points3D Then
With DirectCast(Me.poTChart1.Series(i), Styles.Points3D).Pointer
.VertSize = Max(5 * Me.Size.Height / 1000, 5)
.HorizSize = Max(5 * Me.Size.Height / 1000, 5)
End With
End If
Thanks for your help.
I think I found the problem. I use "Me.Size.Height" to ajust all fonts in my TChart control. When I minimize my Form, the value of "Me.Size.Height" is equal to 31. And 5*31/100 equal 0 for an integer(see below). To correcte the problem I use Max(val1,val2) function. With that I'm sure the value is not 0. I Give you in your upload page a very light version with my problem, if you need more information.
Bad code
If TypeOf (Me.poTChart1.Series(i)) Is Styles.Points3D Then
With DirectCast(Me.poTChart1.Series(i), Styles.Points3D).Pointer
.VertSize = 5 * Me.Size.Height / 1000, 5)
.HorizSize = 5 * Me.Size.Height / 1000, 5)
End With
End If
Solution that correct the problem
If TypeOf (Me.poTChart1.Series(i)) Is Styles.Points3D Then
With DirectCast(Me.poTChart1.Series(i), Styles.Points3D).Pointer
.VertSize = Max(5 * Me.Size.Height / 1000, 5)
.HorizSize = Max(5 * Me.Size.Height / 1000, 5)
End With
End If
Thanks for your help.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Youlrik,
Thanks for the information. I'm glad to hear you found the solution to the problem.
Thanks for the information. I'm glad to hear you found the solution to the problem.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |