"Invalid parameter used" being thrown from 'TextRe

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Adrian
Advanced
Posts: 116
Joined: Thu Jun 23, 2005 4:00 am

"Invalid parameter used" being thrown from 'TextRe

Post by Adrian » Thu Nov 09, 2006 11:27 pm

I've just installed the latest build 2.9.2489.20950 and am occasionally getting the following message
"Property accessor 'TextRenderingHint' on object 'System.Drawing.Graphics' threw the following exception: 'Invalid parameter used.'
the error is throws from the following line,

Code: Select all

tc.Export.Template.Save(memstream)
I'm catching it, and if I retry the operation a few times it works...
Adrian Heald
Captell Developments
www.captelldevelopments.com

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Nov 10, 2006 9:23 am

Hi Adrian,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Adrian
Advanced
Posts: 116
Joined: Thu Jun 23, 2005 4:00 am

Post by Adrian » Fri Nov 10, 2006 11:11 pm

Sorry Narcis,

I can't reproduce it today... I did have some problems with my dev environment yesterday... it was probably related to that. I'll get back to you it it occurs again.

Cheers..
Adrian Heald
Captell Developments
www.captelldevelopments.com

Adrian
Advanced
Posts: 116
Joined: Thu Jun 23, 2005 4:00 am

Post by Adrian » Sun Nov 12, 2006 1:33 am

It's back again...

It can be reproduced using your Teechart for dotnet examples application. I searched for BAR and opened the BAR example, then EDIT and EXPORT then NATIVE, INCLUDE SERIES DATA and click on FILE SIZE... the following error is thrown which is the same as I'm getting in my application when I call

Code: Select all

tc.Export.Template.Save(memstream)
I don't get it every time however and if I do if I reexecute the same code generally it works second time around...

************** Exception Text **************
System.Reflection.TargetInvocationException: Property accessor 'TextRenderingHint' on object 'System.Drawing.Graphics' threw the following exception:'Invalid parameter used.' ---> System.ArgumentException: Invalid parameter used.
at System.Drawing.Graphics.get_TextRenderingHint()
--- End of inner exception stack trace ---
at System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component)
at Steema.TeeChart.Export.TemplateExport.SerializeProperty(String Title, Object value, PropertyDescriptor i, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeObject(String Prefix, Object value, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeProperty(String Title, Object value, PropertyDescriptor i, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeObject(String Prefix, Object value, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeProperty(String Title, Object value, PropertyDescriptor i, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeObject(String Prefix, Object value, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.Serialize(SerializationInfo info, StreamingContext context)
at Steema.TeeChart.Chart.GetObjectData(SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at Steema.TeeChart.Editors.Export.ExportEditor.checkBox3_CheckedChanged(Object sender, EventArgs e)
at System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e)
at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
at System.Windows.Forms.CheckBox.OnClick(EventArgs e)
at System.Windows.Forms.CheckBox.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
TeeChartNetExamples
Assembly Version: 2.0.2489.20950
Win32 Version: 2.0.2489.20950
CodeBase: file:///C:/Program%20Files/Steema%20Software/TeeChart%20for%20.NET%20v2/Examples/DemoProject/bin/ExecutableDemo/TeeChartNetExamples.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
AxInterop.SHDocVw
Assembly Version: 1.1.0.0
Win32 Version: 1.1.0.0
CodeBase: file:///C:/Program%20Files/Steema%20Software/TeeChart%20for%20.NET%20v2/Examples/DemoProject/bin/ExecutableDemo/AxInterop.SHDocVw.DLL
----------------------------------------
Interop.SHDocVw
Assembly Version: 1.1.0.0
Win32 Version: 1.1.0.0
CodeBase: file:///C:/Program%20Files/Steema%20Software/TeeChart%20for%20.NET%20v2/Examples/DemoProject/bin/ExecutableDemo/Interop.SHDocVw.DLL
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------
TeeChart
Assembly Version: 2.0.2489.20950
Win32 Version: 2.0.2489.20950
CodeBase: file:///C:/Program%20Files/Steema%20Software/TeeChart%20for%20.NET%20v2/Examples/DemoProject/bin/ExecutableDemo/TeeChart.DLL
----------------------------------------
System.Design
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.design/1.0.5000.0__b03f5f7f11d50a3a/system.design.dll
----------------------------------------
System.Web
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2037
CodeBase: file:///c:/windows/assembly/gac/system.web/1.0.5000.0__b03f5f7f11d50a3a/system.web.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Drawing.Design
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.drawing.design/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.design.dll
----------------------------------------
Adrian Heald
Captell Developments
www.captelldevelopments.com

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 13, 2006 9:55 am

Hi Adrian,

Thanks for the information. I could reproduce the problem here and added it (TF02011886) to our defect list to be fixed for future releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Jan Madsen
Newbie
Newbie
Posts: 21
Joined: Wed Jun 22, 2005 4:00 am

Post by Jan Madsen » Wed Nov 22, 2006 12:55 pm

Hi Narcis

Do you know when it will be fixed?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 22, 2006 1:00 pm

Hi Michael,

I'm afraid I can't tell you when it will be fixed for now. Please be aware at this forum for new releases announcements and what's being implemented/fixed on each release.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Adrian
Advanced
Posts: 116
Joined: Thu Jun 23, 2005 4:00 am

Post by Adrian » Mon Nov 27, 2006 12:37 am

Hi Narcis,
I appreciate that it's difficult to give an exact date when a bug will be fixed, however this problem is an absolute show stopper for the next release of my application.

With it present the saving of charts is too unreliable so I'm essentially waiting now for an update from you or a suitable workaround.

thanks..
Adrian Heald
Captell Developments
www.captelldevelopments.com

Adrian
Advanced
Posts: 116
Joined: Thu Jun 23, 2005 4:00 am

Post by Adrian » Mon Nov 27, 2006 1:03 am

A little more information about this problem. I backed out the latest Tchart build and reinstalled version 2.0.2489.20950. This fixed the problem, however while making some other changes to my system it re-occured with build 2.0.2489.20950.

As far as I can see if at any stage during the life of the TChart component I set the parent form enabled to FALSE the component will throw this error when trying to save to a memory stream. I don't know if this is a actual cause but it's interesting all the same.
Adrian Heald
Captell Developments
www.captelldevelopments.com

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 27, 2006 11:53 am

Hi Adrian,

Thanks for the information but I can not reproduce the problem here using latest TeeChart maintenance release and the code below. Could you please modify it so that we can reproduce the problem here?

Code: Select all

		private void Form1_Load(object sender, EventArgs e)
		{
			bar1.FillSampleValues();
		}

		private MemoryStream stream;

		private void button1_Click(object sender, EventArgs e)
		{
			this.Enabled = false;

			stream = new MemoryStream();			
			tChart1.Export.Template.Save(stream);

			//tChart1.Clear();
		}

		private void button2_Click(object sender, EventArgs e)
		{
			stream.Position = 0;
			tChart1.Import.Template.Load(stream);
		}
Regarding the FileSize issue, we can no longer reproduce this with our current sources. This is most likely because of some changes we made in exporting routines for other issues. Those changes are included with Build 2.0.2511.18117 from 16th November. Could you please test if it works fine at your end with that release?

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Mont
Newbie
Newbie
Posts: 9
Joined: Tue Aug 17, 2004 4:00 am

Post by Mont » Fri Dec 01, 2006 9:06 am

Narcis,

I've just posted in http://www.teechart.net/support/viewtopic.php?t=5082

I think this is the same problem - the export dialog does work occasionally (without doing anything differently), but I get the error more times than not.

Cheers,

Mike

Adrian
Advanced
Posts: 116
Joined: Thu Jun 23, 2005 4:00 am

Post by Adrian » Mon Dec 04, 2006 2:28 am

This problem is still present using the 2.0.2511.18117 build and the supplied demo... see my post above for how to replicate it.


IT REALLY NEEDS TO BE FIXED URGENTLY!!!!


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Property accessor 'TextRenderingHint' on object 'System.Drawing.Graphics' threw the following exception:'Invalid parameter used.' ---> System.ArgumentException: Invalid parameter used.
at System.Drawing.Graphics.get_TextRenderingHint()
--- End of inner exception stack trace ---
at System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component)
at Steema.TeeChart.Export.TemplateExport.SerializeProperty(String Title, Object value, PropertyDescriptor i, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeObject(String Prefix, Object value, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeProperty(String Title, Object value, PropertyDescriptor i, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeObject(String Prefix, Object value, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeProperty(String Title, Object value, PropertyDescriptor i, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.SerializeObject(String Prefix, Object value, SerializationInfo info)
at Steema.TeeChart.Export.TemplateExport.Serialize(SerializationInfo info, StreamingContext context)
at Steema.TeeChart.Chart.GetObjectData(SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at Steema.TeeChart.Editors.Export.ExportEditor.SaveNativeToFile(String filename)
at Steema.TeeChart.Editors.Export.ExportEditor.button2_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
TeeChartNetExamples
Assembly Version: 2.0.2511.18117
Win32 Version: 2.0.2511.18117
CodeBase: file:///D:/Program%20Files/Steema%20Software/TeeChart%20for%20.NET%20v2/Examples/DemoProject/bin/ExecutableDemo/TeeChartNetExamples.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
AxInterop.SHDocVw
Assembly Version: 1.1.0.0
Win32 Version: 1.1.0.0
CodeBase: file:///D:/Program%20Files/Steema%20Software/TeeChart%20for%20.NET%20v2/Examples/DemoProject/bin/ExecutableDemo/AxInterop.SHDocVw.DLL
----------------------------------------
Interop.SHDocVw
Assembly Version: 1.1.0.0
Win32 Version: 1.1.0.0
CodeBase: file:///D:/Program%20Files/Steema%20Software/TeeChart%20for%20.NET%20v2/Examples/DemoProject/bin/ExecutableDemo/Interop.SHDocVw.DLL
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------
TeeChart
Assembly Version: 2.0.2511.18117
Win32 Version: 2.0.2511.18117
CodeBase: file:///D:/Program%20Files/Steema%20Software/TeeChart%20for%20.NET%20v2/Examples/DemoProject/bin/ExecutableDemo/TeeChart.DLL
----------------------------------------
System.Design
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.design/1.0.5000.0__b03f5f7f11d50a3a/system.design.dll
----------------------------------------
System.Web
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2037
CodeBase: file:///c:/windows/assembly/gac/system.web/1.0.5000.0__b03f5f7f11d50a3a/system.web.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Drawing.Design
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.drawing.design/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.design.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (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 machine
rather than being handled by this dialog.
Adrian Heald
Captell Developments
www.captelldevelopments.com

Adrian
Advanced
Posts: 116
Joined: Thu Jun 23, 2005 4:00 am

Post by Adrian » Mon Dec 04, 2006 4:00 am

I don't know whether this is related but there seems to be another problem that happens when calling the following, though it doesn't happen all the time.

Code: Select all

'  break point 1
tc.Export.Template.Save(memstream)
m_chart.m_bTeeData = memstream.ToArray
'  break point 2
memstream.Close()
I have a line series that has colormember = "" at breakpoint 1 above, after the SAVE the colormember = "Colors"

At breakpoint 1
tc.series(0).colormember "" String

At break point 2
tc.series(0).colormember "Colors" String

There is definately something screwey with tc.Export.Template.Save(memstream)
Adrian Heald
Captell Developments
www.captelldevelopments.com

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Dec 04, 2006 9:56 am

Hi Adrian,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Dec 22, 2006 1:35 pm

Hello everyone,

We have just posted a new maintenance release at the client area which includes a fix for TF02011886.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply