Invalid class typecast

TeeChart for ActiveX, COM and ASP
Post Reply
n00b
Newbie
Newbie
Posts: 8
Joined: Mon Nov 30, 2009 12:00 am

Invalid class typecast

Post by n00b » Thu Apr 01, 2010 6:09 am

I'm getting an error when I try to smooth the series. I'm coding in C++ and I'm trying to smooth via the following:

Code: Select all

m_wndChart.Series(SeriesIndex).GetAsContour().GetSmoothing().SetActive(TRUE);
When I add this line of code in my program, it crashes with the error shown in the attachment.
Attachments
Invalid Class Typecast.png
Invalid Class Typecast.png (16.26 KiB) Viewed 7265 times

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

Re: Invalid class typecast

Post by Narcís » Thu Apr 01, 2010 3:03 pm

Hello,

Code below works fine for me here using TeeChart Pro v8.0.0.8 ActiveX, which is the latest version available at the client area. Can you please check if this works fine at your end and let us know the TeeChart version you are using? If the problem persists can you please attach a simple example project we can run "as-is" to reproduce the problem here?

Code: Select all

	m_Chart1.AddSeries(scContour);
	m_Chart1.Series(0).GetAsContour().GetSmoothing().SetActive(true);
	m_Chart1.Series(0).FillSampleValues(10);
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

n00b
Newbie
Newbie
Posts: 8
Joined: Mon Nov 30, 2009 12:00 am

Re: Invalid class typecast

Post by n00b » Wed Apr 07, 2010 12:01 am

Hi Narcis.

I just checked and our version of TeeChart Pro is v8.0.0.7. I'm downloading the new version and will post my results afterwards.

n00b
Newbie
Newbie
Posts: 8
Joined: Mon Nov 30, 2009 12:00 am

Re: Invalid class typecast

Post by n00b » Wed Apr 07, 2010 12:52 am

I registered the new ocx but am still receiving the error. I'm beginning to think that I'm calling the wrong methods for what I'm trying to do so I'll back up a little.

On the TChart Editor there is a little check box on the bottom left hand corner called "Smooth". When I click that it seems to smooth out the appearance of the graphs. What is the methods I need to call in C++ to emulate this behaviour?

I've attached screen shots for clarity.
Attachments
Non-Smooth.png
Non-Smooth.png (124.3 KiB) Viewed 7227 times
Smooth.png
Smooth.png (235.06 KiB) Viewed 7259 times

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

Re: Invalid class typecast

Post by Narcís » Wed Apr 07, 2010 7:43 am

Hello,

You can use AntiAlias tool as I told here.
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

n00b
Newbie
Newbie
Posts: 8
Joined: Mon Nov 30, 2009 12:00 am

Re: Invalid class typecast

Post by n00b » Thu Apr 08, 2010 1:02 am

Thanks figured it out but won't be using it for my implementation.

For those interested, the code in c++ is:

Code: Select all

myChart1.GetCanvas().SetUseAntiAlias(TRUE);

Post Reply