Hello,
I am having a strange problem with teechart.
I have a chart in a form I am using, when the form is hidden and then shown again an exception is thrown caused by a paint handler in teechart.
Other forms with charts seem to be able to hide and show again easily.
I have included a stack trace. I can't really provide code to reproduce this as it would really need the whole application and some hardware!
Any help would be much appreciated!
Dave
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'NewScanWindow'.
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.ContainerControl.FocusActiveControlInternal()
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.Show()
at LPPS_UI.LPPSUI.newScanCommand() in C:\Documents and Settings\Dev\Desktop\Source Code\LPPS UI\LPPS UI\LPPSUI.cs:line 177
at LPPS_UI.LPPSUI.newToolStripButton_Click(Object sender, EventArgs e) in C:\Documents and Settings\Dev\Desktop\Source Code\LPPS UI\LPPS UI\LPPSUI.cs:line 217
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.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.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
LPPS UI
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/LPPS%20UI.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
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.3053 (netfxsp.050727-3000)
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.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
SplashScreen
Assembly Version: 1.0.3218.24629
Win32 Version: 1.0.3218.24629
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/SplashScreen.DLL
----------------------------------------
Delegates
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/Delegates.DLL
----------------------------------------
DSOCSFactory
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/DSOCSFactory.DLL
----------------------------------------
Laser
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/Laser.DLL
----------------------------------------
FTD2XX_NET
Assembly Version: 1.0.2.0
Win32 Version: 1.0.2.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/FTD2XX_NET.DLL
----------------------------------------
Monochromator
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/Monochromator.DLL
----------------------------------------
Experiment
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/Experiment.DLL
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
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.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
AxInterop.ZOLIXOMNISPECLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/AxInterop.ZOLIXOMNISPECLib.DLL
----------------------------------------
LPPS UI.resources
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/en/LPPS%20UI.resources.DLL
----------------------------------------
Interop.ZOLIXOMNISPECLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/Interop.ZOLIXOMNISPECLib.DLL
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
ToolBox
Assembly Version: 1.0.4.0
Win32 Version: 1.0.4.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/ToolBox.DLL
----------------------------------------
Scan Settings
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/Scan%20Settings.DLL
----------------------------------------
ejhqad_5
Assembly Version: 1.0.3218.24629
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
yuorcp_5
Assembly Version: 1.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
y5tij6kg
Assembly Version: 1.0.4.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
TeeChart
Assembly Version: 3.5.3146.24806
Win32 Version: 3.5.3146.24806
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/TeeChart.DLL
----------------------------------------
UIParamValidators
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Dev/Desktop/Source%20Code/LPPS%20UI/LPPS%20UI/bin/Debug/UIParamValidators.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.
Hide()/Show() exception : Fixed
Hide()/Show() exception : Fixed
Last edited by Dave on Fri Oct 24, 2008 11:07 am, edited 1 time in total.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Dave,
It's very difficult for us finding which the problem is and fixing it without being able to reproduce it. So it would be very helpful if you could isolate the problem and arrange a simple example project we can run "as-is" to reproduce the issue 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's very difficult for us finding which the problem is and fixing it without being able to reproduce it. So it would be very helpful if you could isolate the problem and arrange a simple example project we can run "as-is" to reproduce the issue 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 |
Okay, i think this should replicate the problem, also doing it seems to have helped me track it down!
Ive uploaded a file to demonstrate.
Sorry the examples a bit hacked together!
In the example a form2 is created as an mdichild of a form1.
When you click the button on form 2 (the one with the tchart) it hides it, then when you click on the button on form 1 (the mdi parent) it tries to Show() form2 again at which point you get an unhandled exception.
It seems to be the MDI parent/child part which is causing the problem as it does not seem to occur if form1 just contains form2 as an ordinary variable.
Hope this helps and that you can help me!
Thanks in advance,
Dave
Ive uploaded a file to demonstrate.
Sorry the examples a bit hacked together!
In the example a form2 is created as an mdichild of a form1.
When you click the button on form 2 (the one with the tchart) it hides it, then when you click on the button on form 1 (the mdi parent) it tries to Show() form2 again at which point you get an unhandled exception.
It seems to be the MDI parent/child part which is causing the problem as it does not seem to occur if form1 just contains form2 as an ordinary variable.
Hope this helps and that you can help me!
Thanks in advance,
Dave
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Dave,
Thanks for the example project. We could solve the issue here initializing Form2 like this:
Can you please check if this works fine at your end?
Thanks in advance.
Thanks for the example project. We could solve the issue here initializing Form2 like this:
Code: Select all
public Form2() {
InitializeComponent();
this.tChart1.Graphics3D.UseBuffer = false;
}
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 Dave,
You're welcome.
This because there seem to be a number of problems using the BufferedGraphics and BufferedGraphicsContext classes with MDI applications.
You're welcome.
This because there seem to be a number of problems using the BufferedGraphics and BufferedGraphicsContext classes with MDI applications.
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 |