Access to Steema.TeeChart.Chart.ChartRect ?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Michael Breu
Newbie
Newbie
Posts: 8
Joined: Wed Feb 06, 2008 12:00 am
Location: Austria
Contact:

Access to Steema.TeeChart.Chart.ChartRect ?

Post by Michael Breu » Sun Mar 16, 2008 12:24 pm

Hello,

VS 2005 is giving me the following warning (sorry this is the German version, I will translate it below)
Das Zugreifen auf einen Member auf "Steema.TeeChart.Chart.ChartRect" kann zu einer Laufzeitausnahme führen, da es sich hierbei um ein Feld einer Marshal-by-reference-Klasse handelt.


Translated:

Accessing the member of "Steema.TeeChart.Chart.ChartRect" may cause a runtime exception, because it is a field of a Marshal-by-reference-Class.

What is the recommended way to avoid this warning (i.e. to access
Steema.TeeChart.Chart.ChartRect in a secure way)?

Michael

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 Mar 17, 2008 9:11 am

Hi Michael,

Yes, line below produces such warning.

Code: Select all

			int w1 = tChart1.Chart.ChartRect.Width;
You can avoid it doing this:

Code: Select all

			Rectangle rect = tChart1.Chart.ChartRect;
			int w2 = rect.Width;
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