Page 1 of 1

ChartEditor crash on Themes tab click

Posted: Thu Jul 24, 2008 5:42 pm
by 14045277
The ChartEditor with 3.5.3105.20152 crashes the app immediately when the Themes tab is clicked.

Workaround is to hide the unneccesary tab.

Possible related information: The computers used are NOT connected to the internet.

Posted: Mon Jul 28, 2008 8:58 am
by narcis
Hi georgez,

I'm not able to reproduce the issue here. It works fine even unplugging the computer from the internet. Are there any specific steps we should follow to reproduce the issue here?

Thanks in advance.

Posted: Mon Jul 28, 2008 2:26 pm
by 14045277
Thanks for your response. There is not much to tell you. We make a form with TeeCommander and TeeChart, populate one or more series from a DataTable source, click the ChartEditor button, click the Themes tab - crash.
(BTW - not a newbie - been using TeeChart since Delphi2.)

Posted: Mon Jul 28, 2008 2:54 pm
by narcis
Hi georgez,

Thanks for the information. That's what I tried here and couldn't reproduce the issue using this code:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();		
		}

		private void InitializeChart()
		{
			Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
			bar1.Clear();
			bar1.DataSource = CreateDataSet();
			bar1.YValues.DataMember = "SALARY";
			bar1.XValues.DataMember = "ID";
			bar1.LabelMember = "LASTNAME";

			bar1.CheckDataSource(); 
		}

		private DataTable CreateDataSet()
		{
			DataTable Employee = new DataTable();

			DataColumn SALARY = new DataColumn("SALARY", Type.GetType("System.Int32"));
			DataColumn ID = new DataColumn("ID", Type.GetType("System.Int32"));
			DataColumn LASTNAME = new DataColumn("LASTNAME", Type.GetType("System.String"));

			Employee.Columns.Add(SALARY);
			Employee.Columns.Add(ID);
			Employee.Columns.Add(LASTNAME);

			DataRow dataRow;
			
			dataRow = Employee.NewRow();
			dataRow[SALARY] = 10000;
			dataRow[ID] = 1;
			dataRow[LASTNAME] = "Jones";

			Employee.Rows.Add(dataRow);

			dataRow = Employee.NewRow();
			dataRow[SALARY] = 12000;
			dataRow[ID] = 2;
			dataRow[LASTNAME] = "Smith";

			Employee.Rows.Add(dataRow);

			dataRow = Employee.NewRow();
			dataRow[SALARY] = 9000;
			dataRow[ID] = 3;
			dataRow[LASTNAME] = "Johnson";

			Employee.Rows.Add(dataRow);

			return Employee;
		} 
Could you please modify it or send us a simple example project so that we can reproduce the problem here?

Files can be posted at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Mon Jul 28, 2008 3:30 pm
by 14045277
I created a new project, added teechart.dll to the references, added a tChart1 to the form, substituted your code and did a build. Then, each time the pre-built app was started it took 10 seconds to appear. (Dual Pentium, 2.8Ghz, 2GB)

Posted: Mon Jul 28, 2008 5:09 pm
by 14045277
Sorry about the previous post - I got my bug reports mixed up.

Your code does not mention Editor or Themes. Are they supposed to be included?

Posted: Mon Jul 28, 2008 10:40 pm
by 14045277
Hi Narcis,

Here is the complete answer to your suggestion:

I created a new project,
added teechart.dll to the references,
added a tChart1 to the form,
added a editor1 to the form,
set the editor1.Chart property to tChart1,
substituted your code,
added a doubleclick method to tChart1 to ShowEditor,
and did a build.

Then, each time the pre-built app was started it took 10 seconds to appear. (Dual Pentium, 2.8Ghz, 2GB)

Next, I doubleclicked the chart to show the editor,
clicked the Themes tab,
and it CRASHED.

All of the following is information from the exception:

"Access to the path is denied.

System.Collections.ListDictionaryInternal.NodeKeyValueCollection

System.IO.FileSystemInfo.set_Attributes at Steema.TeeChart.Editors.ThemeEditor.AddCustomThemes"

I hope this is what you need.
Regards,
george

Posted: Tue Jul 29, 2008 8:18 am
by narcis
Hi george,

Thanks for the information and sorry if my reply wasn't clear enough. I was using a ChartController instead of an editor. Anyway, using this code:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();		
		}

		private Steema.TeeChart.Editor editor1;

		private void InitializeChart()
		{
			Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
			bar1.Clear();
			bar1.DataSource = CreateDataSet();
			bar1.YValues.DataMember = "SALARY";
			bar1.XValues.DataMember = "ID";
			bar1.LabelMember = "LASTNAME";

			bar1.CheckDataSource();

			editor1 = new Steema.TeeChart.Editor(tChart1);

			tChart1.DoubleClick += new EventHandler(tChart1_DoubleClick);
		}

		void tChart1_DoubleClick(object sender, EventArgs e)
		{
			editor1.ShowModal();
		}

		private DataTable CreateDataSet()
		{
			DataTable Employee = new DataTable();

			DataColumn SALARY = new DataColumn("SALARY", Type.GetType("System.Int32"));
			DataColumn ID = new DataColumn("ID", Type.GetType("System.Int32"));
			DataColumn LASTNAME = new DataColumn("LASTNAME", Type.GetType("System.String"));

			Employee.Columns.Add(SALARY);
			Employee.Columns.Add(ID);
			Employee.Columns.Add(LASTNAME);

			DataRow dataRow;
			
			dataRow = Employee.NewRow();
			dataRow[SALARY] = 10000;
			dataRow[ID] = 1;
			dataRow[LASTNAME] = "Jones";

			Employee.Rows.Add(dataRow);

			dataRow = Employee.NewRow();
			dataRow[SALARY] = 12000;
			dataRow[ID] = 2;
			dataRow[LASTNAME] = "Smith";

			Employee.Rows.Add(dataRow);

			dataRow = Employee.NewRow();
			dataRow[SALARY] = 9000;
			dataRow[ID] = 3;
			dataRow[LASTNAME] = "Johnson";

			Employee.Rows.Add(dataRow);

			return Employee;
		} 
I'm not able to reproduce the issue here either building the application in debug or release mode. How are you building it?

BTW: I'm using an Intel Core 2 Quad 6600 machine with 4GB RAM.

Posted: Tue Jul 29, 2008 3:01 pm
by 14045277
Narcis,

You still didn't mention clicking the Themes tab.

I went through the entire exercise again using your new code.

The result is: clicking the Themes tab crashes in either debug or release.

Here is the complete stack trace:
" at System.IO.FileSystemInfo.set_Attributes(FileAttributes value)\r\n at Steema.TeeChart.Editors.ThemeEditor.AddCustomThemes(Object[]& ObjectCollection)\r\n at Steema.TeeChart.Editors.ThemeEditor.AddThemes(Object[]& ObjectCollection)\r\n at Steema.TeeChart.Editors.ThemeEditor..ctor(Chart c, Control p)\r\n at Steema.TeeChart.Editors.ChartEditor.tabControl1_SelectedIndexChanged(Object sender, EventArgs e)\r\n at System.Windows.Forms.TabControl.OnSelectedIndexChanged(EventArgs e)\r\n at System.Windows.Forms.TabControl.WmSelChange()\r\n at System.Windows.Forms.TabControl.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)\r\n at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)\r\n at System.Windows.Forms.Control.WmNotify(Message& m)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n at System.Windows.Forms.ContainerControl.WndProc(Message& m)\r\n at System.Windows.Forms.Form.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)\r\n at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)\r\n at System.Windows.Forms.Control.DefWndProc(Message& m)\r\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.TabControl.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)\r\n at Steema.TeeChart.Editor.ShowModal(Control owner)\r\n at Steema.TeeChart.Editor.ShowModal()\r\n at WindowsApplication1.Form1.tChart1_DoubleClick(Object sender, EventArgs e) in C:\\Documents and Settings\\zabriskieg.ITT\\My Documents\\Visual Studio 2005\\Projects\\WindowsApplication1\\WindowsApplication1\\Form1.cs:line 38\r\n at System.EventHandler.Invoke(Object sender, EventArgs e)\r\n at System.Windows.Forms.Control.OnDoubleClick(EventArgs e)\r\n at Steema.TeeChart.TChart.OnDoubleClick(EventArgs e)\r\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at WindowsApplication1.Program.Main() in C:\\Documents and Settings\\zabriskieg.ITT\\My Documents\\Visual Studio 2005\\Projects\\WindowsApplication1\\WindowsApplication1\\Program.cs:line 17\r\n at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"

Posted: Tue Jul 29, 2008 3:28 pm
by Chris
Hello,
georgez wrote: The result is: clicking the Themes tab crashes in either debug or release.
In your particular case, this may be true. Are you using Custom Themes? The stack trace certainly suggests you are. The method AddCustomThemes() only sets the FileSystemInfo.Attributes property if the path specified in the ThemeFolder value within the TeeChart registry key exists (which it doesn't after a default installation) and this folder contains *.xml files. You can check the registry value by navigating to the following registry key using Start -> Run -> regedit:
HKEY_LOCAL_MACHINE\SOFTWARE\Steema Software\TeeChart.NET

Please check that the path specified in the ThemeFolder value exists on your machine and that it contains *.xml files. If you do not need these files for your application, the easiest solution would be to delete the ThemeFolder registry value from the above mentioned key. If you do need these files then we will need to work out why setting the FileSystemInfo.Attributes property on them throws an exception.

Posted: Tue Jul 29, 2008 5:20 pm
by 14045277
Are you using Custom Themes? The stack trace certainly suggests you are.
We are using NO themes. Whatever exists is exactly as placed there by your downloaded installer.

Posted: Tue Jul 29, 2008 6:02 pm
by Chris
georgez wrote:We are using NO themes. Whatever exists is exactly as placed there by your downloaded installer.
I see. Ok, in which case you may like to follow my previous suggestion and delete the ThemeFolder value from within the TeeChart registry key.

Posted: Tue Jul 29, 2008 7:17 pm
by 14045277
Thanks for your help Christopher and Narcis. Since not everyone has Registry access, we will continue with our initial workaround.