Page 1 of 1

Invalid class typecast

Posted: Thu Apr 01, 2010 6:09 am
by 15054756
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.

Re: Invalid class typecast

Posted: Thu Apr 01, 2010 3:03 pm
by narcis
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.

Re: Invalid class typecast

Posted: Wed Apr 07, 2010 12:01 am
by 15054756
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.

Re: Invalid class typecast

Posted: Wed Apr 07, 2010 12:52 am
by 15054756
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.

Re: Invalid class typecast

Posted: Wed Apr 07, 2010 7:43 am
by narcis
Hello,

You can use AntiAlias tool as I told here.

Re: Invalid class typecast

Posted: Thu Apr 08, 2010 1:02 am
by 15054756
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);