Teechart V 3 crashes on hide and unhide of containing window
-
- Newbie
- Posts: 41
- Joined: Wed Jan 30, 2008 12:00 am
Teechart V 3 crashes on hide and unhide of containing window
Steps to recreate
1) The chart control is hidden to begin with and the containing (tabbed mdi child) window is not.
2) The containing (tabbed mdi child) window is hidden and then unhidden.
3) The chart control is unhidden when the containing (tabbed mdi child) window is activated by clicking on the tab.
4) The chart control is hidden when the containing (tabbed mdi child) window is deactivated by clicking on a different tab.
5) The containing (tabbed mdi child) window is hidden and then unhidden.
6) The chart control is unhidden when the containing (tabbed mdi child) window is activated by clicking on the tab.
You will get the error "System.ArgumentException: Parameter is not valid.
" on windows xp professional, call stack is provided below. On Vista 64 you will get “The Red X”.
Note: 1) Used Infragistics.Win.UltraWinTabbedMdi.UltraTabbedMdiManager for the tabs.
2)Teechart V2 works like a charm, it’s the Teechart V3 that crashes.
System.ArgumentException: Parameter is not valid.
at System.Drawing.Graphics.GetHdc()
at System.Drawing.BufferedGraphics.Render(Graphics target)
at System.Drawing.BufferedGraphics.Render()
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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
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.Run(Form mainForm)
1) The chart control is hidden to begin with and the containing (tabbed mdi child) window is not.
2) The containing (tabbed mdi child) window is hidden and then unhidden.
3) The chart control is unhidden when the containing (tabbed mdi child) window is activated by clicking on the tab.
4) The chart control is hidden when the containing (tabbed mdi child) window is deactivated by clicking on a different tab.
5) The containing (tabbed mdi child) window is hidden and then unhidden.
6) The chart control is unhidden when the containing (tabbed mdi child) window is activated by clicking on the tab.
You will get the error "System.ArgumentException: Parameter is not valid.
" on windows xp professional, call stack is provided below. On Vista 64 you will get “The Red X”.
Note: 1) Used Infragistics.Win.UltraWinTabbedMdi.UltraTabbedMdiManager for the tabs.
2)Teechart V2 works like a charm, it’s the Teechart V3 that crashes.
System.ArgumentException: Parameter is not valid.
at System.Drawing.Graphics.GetHdc()
at System.Drawing.BufferedGraphics.Render(Graphics target)
at System.Drawing.BufferedGraphics.Render()
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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
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.Run(Form mainForm)
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Srinivas,
Would you be so kind to send us a simple example project we can run "as-is" to reproduce the problem here and let us know the exact TeeChart version you are using?
You may be also interested in checking this recent issue related to the use of TeeChart together with Infragistics components.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Would you be so kind to send us a simple example project we can run "as-is" to reproduce the problem here and let us know the exact TeeChart version you are using?
You may be also interested in checking this recent issue related to the use of TeeChart together with Infragistics components.
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 |
-
- Newbie
- Posts: 41
- Joined: Wed Jan 30, 2008 12:00 am
-
- Newbie
- Posts: 41
- Joined: Wed Jan 30, 2008 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Srinivas,
Thank you very much for the example project. This certainly helped reproducing the issue here. You can solve it setting tChart1.Chart.Graphics3D.BackBuffer = null; when changing tabs, for example:
Thank you very much for the example project. This certainly helped reproducing the issue here. You can solve it setting tChart1.Chart.Graphics3D.BackBuffer = null; when changing tabs, for example:
Code: Select all
private void Chart_Activated(object sender, EventArgs e)
{
tChart1.Chart.Graphics3D.BackBuffer = null;
tChart1.Visible = true;
}
private void Chart_Deactivate(object sender, EventArgs e)
{
tChart1.Chart.Graphics3D.BackBuffer = null;
tChart1.Visible = false;
}
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi lolo31,
Would you be so kind to also send a sample project we can run "as-is" to investigate the issue here?
Thanks in advance.
Would you be so kind to also send a sample project we can run "as-is" to investigate the issue here?
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 |
Sorry but I can't access to newsgroup or upload page from my Office.
It's very simple to do:
1) Create a new project with Form1
2) Add a new Form2
3) Put a button on Form1 and add "Form2.showDialog()" in the Button_Click
4) On the Form2, put a chart and a button to close the form
Run and open twice the Form2.
NB: The Version of TeeChart is 3.2.2980.19082 on Visual Studio.Net 2005 SP1
Regards.
It's very simple to do:
1) Create a new project with Form1
2) Add a new Form2
3) Put a button on Form1 and add "Form2.showDialog()" in the Button_Click
4) On the Form2, put a chart and a button to close the form
Run and open twice the Form2.
NB: The Version of TeeChart is 3.2.2980.19082 on Visual Studio.Net 2005 SP1
Regards.
-
- Newbie
- Posts: 41
- Joined: Wed Jan 30, 2008 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi lolo31,
I've made a project like you reported but I'm not able to reproduce the problem here. The steps I followed are:
1. Run the application.
2. Click the button in Form1 to open Form2.
3. Close Form2 instance.
4. Click the button in Form1 to open Form2.
5. Close Form2 instance.
Form1 code:
Form2 code:
Can you please confirm those are the correct steps to reproduce the issue?
Thanks in advance.
Thanks for the information. It seems we are having some problems with www.steema.net server .lolo31 wrote:Sorry but I can't access to newsgroup or upload page from my Office.
It's very simple to do:
1) Create a new project with Form1
2) Add a new Form2
3) Put a button on Form1 and add "Form2.showDialog()" in the Button_Click
4) On the Form2, put a chart and a button to close the form
Run and open twice the Form2.
NB: The Version of TeeChart is 3.2.2980.19082 on Visual Studio.Net 2005 SP1
Regards.
I've made a project like you reported but I'm not able to reproduce the problem here. The steps I followed are:
1. Run the application.
2. Click the button in Form1 to open Form2.
3. Close Form2 instance.
4. Click the button in Form1 to open Form2.
5. Close Form2 instance.
Form1 code:
Code: Select all
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 f = new Form2();
f.ShowDialog();
}
}
Code: Select all
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
}
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi lolo31,
Using VB I need to do as shown below and the problem doesn't occur either.
Form1:
Form2:
How do you think I should modify the code to reproduce the issue here?
Thanks in advance.
Using VB I need to do as shown below and the problem doesn't occur either.
Form1:
Code: Select all
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f As New Form2
f.ShowDialog()
End Sub
End Class
Code: Select all
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim line1 As New Steema.TeeChart.Styles.Line(TChart1.Chart)
line1.FillSampleValues()
End Sub
End Class
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi lolo31,
This doesn't seem correct to me as ShowDialog is not a static method I don't think it should be directly called from the class.
Anyway, if you wish to continue working that way you don't need to set BackBuffer to Nothing as reseting the chart (TChart1.Clear) works fine as well:
This doesn't seem correct to me as ShowDialog is not a static method I don't think it should be directly called from the class.
Anyway, if you wish to continue working that way you don't need to set BackBuffer to Nothing as reseting the chart (TChart1.Clear) works fine as well:
Code: Select all
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TChart1.Clear()
'TChart1.Chart.Graphics3D.BackBuffer = Nothing
Dim line1 As New Steema.TeeChart.Styles.Line(TChart1.Chart)
line1.FillSampleValues()
End Sub
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Srinivas,
If you don't want to set BackBuffer to null you can also set UseBuffer property to false:
We don't consider this to be a bug in v3. It's because of the implementation of manual doublebuffering feature as you can read here.Srinivas wrote:Thank You Narcís, it worked.
I guess this is a workaround as it is perfectly working without BackBuffer = null in V2. Will you be fixing this in next release of V3?
If you don't want to set BackBuffer to null you can also set UseBuffer property to false:
Code: Select all
public partial class Chart : Form
{
public Chart()
{
InitializeComponent();
}
private void Chart_Load(object sender, EventArgs e)
{
fastLine1.FillSampleValues();
fastLine2.FillSampleValues();
fastLine3.FillSampleValues();
tChart1.Graphics3D.UseBuffer = false;
}
private void Chart_Activated(object sender, EventArgs e)
{
//tChart1.Chart.Graphics3D.BackBuffer = null;
tChart1.Visible = true;
}
private void Chart_Deactivate(object sender, EventArgs e)
{
//tChart1.Chart.Graphics3D.BackBuffer = null;
tChart1.Visible = false;
}
}
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 |