Page 1 of 2
Object reference not set to an instance of an object.
Posted: Wed Sep 28, 2005 10:28 am
by 9638303
Dear Sir/Madam
I have another problem in .Net Version2
When I change the bar chart to pie I get this error
System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.Pie.CalcClickedPie(Int32 x, Int32 y)
at Steema.TeeChart.Styles.Pie.Clicked(Int32 x, Int32 y)
at Steema.TeeChart.Tools.MarksTip.FindClickedSeries(Int32 x, Int32 y, Int32& index)
at Steema.TeeChart.Tools.MarksTip.MouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e)
at Steema.TeeChart.TChart.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.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)
We don’t have any problem when we still using the .Net version 1
Any ideas?
Thank & Best Regards
Eric
Posted: Wed Sep 28, 2005 10:49 am
by narcis
Hi Eric,
It works fine here using latest v2 release available and the code below. Can you please test if this works for you? If it doesn't help you solving your problems please send us an example we can run "as-is" to reproduce the problem here.
You can post your files at [url]news://
www.steema.net/steema.public.attachments[/url] newsgroup.
Code: Select all
private void button3_Click(object sender, System.EventArgs e)
{
Steema.TeeChart.Styles.Series s=tChart1[0];
Steema.TeeChart.Styles.Series.ChangeType(ref s,typeof(Steema.TeeChart.Styles.Pie));
tChart1[0].ColorEach=true;
}
Posted: Wed Sep 28, 2005 11:47 am
by 9638303
Dear Sir/Madam
Can you give me Vb.Nert example
can i upload the chart.ten file for you to test?
Thank & Best Regard
Eric
Posted: Wed Sep 28, 2005 12:57 pm
by narcis
Hi Eric,
Can you give me Vb.Nert example
Sure, it is:
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s As Steema.TeeChart.Styles.Series = TChart1(0)
Steema.TeeChart.Styles.Series.ChangeType(s, GetType(Steema.TeeChart.Styles.Pie))
TChart1(0).ColorEach = True
End Sub
BTW: To help you translate C# code to VB.NET you can use on of those tools:
http://www.kamalpatel.net/ConvertCSharp2VB.aspx
http://authors.aspalliance.com/aldotnet ... slate.aspx
can i upload the chart.ten file for you to test?
Yes please, post it at the attachments newsgroup I mentioned you before.
Posted: Wed Sep 28, 2005 1:18 pm
by 9638303
Dear Sir/Madam
I don't know
how to create a sample program to show you the problem.
It work fine import from the .ten file. That why I didnt post the ten file to you
But comfirm it work at the .net version 1.
Below is how my code to change the chart style to pie.
Dim objChartStyle As New Steema.TeeChart.Styles.Pie
Chart.Series(i).ChangeType(Chart.Series(i), objChartStyle.GetType)
Chart.Series(i).ColorEach = True
objChartStyle = Nothing
Can you please double check what is the different between version 1 and version 2?
or can you give me a version 1. I really give up for this problem.
before we bought the version 2, we use the trial version to build one.
Thank & Best Regard
Eric
Posted: Wed Sep 28, 2005 2:07 pm
by narcis
Hi Eric,
I've tested both aproaches (yours and mine) and work fine in both .NET versions using latest releases available at our Customers Download Area. Which v1 and v2 versions are you using? Does the snippet I posted work fine for your application?
Posted: Wed Sep 28, 2005 2:47 pm
by 9638303
Oh.. sorry we are using below the version to test build our control.
TeeChartNET1 1.1.1879.21176.exe
The code that you post to me still the same.
I think is not because the changing chart style code problem. My control will set alot of setting before diplay the chart and user only able to change the chart style after my control has done of many chat setting.
Like, 3D style, Marktips......
So how... :'( .....
Really hope you all can double check the code....
Thank & Best Regard
Eric
Posted: Wed Sep 28, 2005 3:32 pm
by 9638303
When I run in debug mode. .Net popup this error.
An unhandled exception of type 'System.NullReferenceException' occurred in theechart.dll
Additional information: Object reference not set to an instance of an object
Posted: Thu Sep 29, 2005 3:54 am
by 9638303
Dear Sir/Madam
I did download TeeChartNET2DebugBuild.exe and still have the same problem.
After uninstall the version 2/ Debug Build and reinstall back the version 1
Everything work fine....
No choice I have to use the version 1 first.
Thank & Best Regard
Eric
Posted: Thu Sep 29, 2005 10:58 am
by narcis
Hi Eric,
I guess you are setting some properties for your original series that are not available on the series type you are changing to and this causes the error. You could disable all this properties to see if it stops your error from happening and if so then enabling them again one by one to see which ones are giving you an error.
It is pretty difficult for us to help you without being able to reproduce the problem here. So please try what I'm suggesting you above and if it doesn't solve the problem, create a small project with those settings so that we can run it "as-is" to reproduce the problem here. Please post your files at [url]news://
www.steema.net/steema.public.attachments[/url] newsgroup.
Posted: Thu Sep 29, 2005 12:31 pm
by 9638303
OK. I will try my best to find out what are the properties that original has been set.
Eric
Posted: Thu Sep 29, 2005 5:21 pm
by 9638303
Dear Sir/Madam,
I've post the .ten & sample vb application file for you to test. Please refer to the step below in-order to test the error: -
1. Run the WindowsApplication2\bin\WindowsApplication2.exe
2. Click the button and import then test.ten file
3. Error should occurs and show below the error message.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.Pie.CalcClickedPie(Int32 x, Int32 y)
at Steema.TeeChart.Styles.Pie.Clicked(Int32 x, Int32 y)
at Steema.TeeChart.Tools.MarksTip.FindClickedSeries(Int32 x, Int32 y, Int32& index)
at Steema.TeeChart.Tools.MarksTip.MouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e)
at Steema.TeeChart.TChart.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.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)
Thank & Best Regard
Eric
[/b]
Posted: Thu Sep 29, 2005 5:26 pm
by 9638303
Dear Sir/Madam,
I've post the .ten & sample vb application file for you to test. Please refer to the step below in-order to test the error:
1. Run the WindowsApplication2\bin\WindowsApplication2.exe
2. Click the button and import then test.ten file
3. Error should occurs and show below the error message.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.Pie.CalcClickedPie(Int32 x, Int32 y)
at Steema.TeeChart.Styles.Pie.Clicked(Int32 x, Int32 y)
at Steema.TeeChart.Tools.MarksTip.FindClickedSeries(Int32 x, Int32 y, Int32& index)
at Steema.TeeChart.Tools.MarksTip.MouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e)
at Steema.TeeChart.TChart.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.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)
Thank & Best Regard
Eric
[/b]
Posted: Fri Sep 30, 2005 8:28 am
by narcis
Dear Eric,
Thanks for the example application but I can not download the .ten file as I get the error below. Could you please arrange it so that I can download it or post the file at [url]news://
www.steema.net/steema.public.attachments[/url] newsgroup?
---------------------------
Microsoft Internet Explorer
---------------------------
Internet Explorer cannot download test.ten from URL.
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
---------------------------
OK
---------------------------
Thanks in advance.
Posted: Fri Sep 30, 2005 9:10 am
by 9638303
Dear Sir/Madam,
Sorry about that, I did double check the file. It exist in our web server.
anyway you can find the test.ten file in side the zip file
WindowsApplication2\bin\test.ten
By the way, I don't know how to post the file to the news://
www.steema.net/steema.public.attachments
Haha Sorry about that, Please let me know when you finish it, because we want to remove the zip & ten file from the web server.
Thanks & Best Regards
Eric