Page 1 of 1
VC++ example "Surface" does not work!
Posted: Tue Nov 18, 2003 5:48 am
by 9078641
When I compile the surface example and run it.
This line in function void CSurfaceDlg::FillSurface()
aSeries.SetNumZValues(m_ctrlSlider.GetPos());
throws an exception. !
The message is
Invalid Number of parameters !
As it is a "working" example of how to use TeeChart, I wonder why I get the exception... of course I assume it is a real working example.
Posted: Tue Nov 18, 2003 10:34 am
by Pep
Hi,
which example are you referencing ?
Best Regards !
Josep Lluis Jorge
http://support.steema.com
Posted: Tue Nov 18, 2003 2:52 pm
by 9078641
The project is in surface.zip under Examples: VC++
Posted: Wed Nov 19, 2003 11:11 am
by Pep
This example is not included in the TeeChart Pro AX installation. Are you sure this project has not been created by you ?
Josep Lluis Jorge
http://support.steema.com
Posted: Wed Nov 19, 2003 4:15 pm
by 9078641
Pep wrote:This example is not included in the TeeChart Pro AX installation. Are you sure this project has not been created by you ?
Josep Lluis Jorge
http://support.steema.com
No I have not done a surface example yet, I soon need to get to do it, and that is why I studied the surface example delivered by Teechart.
I noticed the readem file say';s it's version 3 ! Perhaps the things is so old it not longer sorks with TeeChart 6.
When I installed Version 6 it put a zip file in the examples directory in an the zip file is a Readme.txt
this is the contents of the readme (notice it says version 3)
*************************************
* TeeChart Pro ActiveX version 3 *
* *
* Examples for MS Visual C++ *
* *
* teeMach SL, Barcelona *
*
www.teemach.com *
* email
sales@teemach.com *
*************************************
Contents
========
The Zipfile includes the following examples:
1. Automation.zip - example of OLE Automation
2. Dragging.zip - Interactive Charts using mouse events
3. JPEG.zip - Save TeeChart to JPEG file
4. Printing.zip - Sharing a Chart with text on a printed page
5. Scrolling.zip - Add points and scroll Chart
6. Surface.zip - Use of Surface Series
All examples use the TeeChartDefines.H constant header file.
You will need to add this file to the workspace folder of
each project.
Posted: Tue Nov 25, 2003 4:06 pm
by Pep
I've tried to compile this example (from the zip file) and compiles/runs fine here.
Could you please re-download the zip file which contains all the examples from .
http://www.steema.com/support/faq/NewAX ... amples.zip
unzip and test it again ?
Josep Lluis Jorge
http://support.steema.com
Same problem
Posted: Wed Nov 26, 2003 4:55 am
by 9078641
OK I donwloaded the and compiled it again.
The same problem
In the function FillSurface() the line
"aSeries.SetNumZValues(m_ctrlSlider.GetPos());" is the problem
I glad to see the sampel does come from TeeChart
Hans W
void CSurfaceDlg::FillSurface()
{
>>>>>>> code removed here for clarity
// set initial surface size (rows x columns)
aSeries.SetNumXValues(m_ctrlSlider.GetPos());
aSeries.SetNumZValues(m_ctrlSlider.GetPos()); // This line is the problem
Posted: Wed Nov 26, 2003 10:47 am
by Chris
If you're after a TeeChart VC++ surface example build with a version of TeeChart AX less than four years old, may I suggest that you have a look at the example under:
C:\Program Files\Steema Software\TeeChart Pro v6 ActiveX Control\Examples\Visual C++\Version 6\SeriesTextSource
Best regards,
Christopher Ireland
Posted: Wed Nov 26, 2003 7:50 pm
by 9078641
Christopher Ireland wrote:If you're after a TeeChart VC++ surface example build with a version of TeeChart AX less than four years old, may I suggest that you have a look at the example under:
C:\Program Files\Steema Software\TeeChart Pro v6 ActiveX Control\Examples\Visual C++\Version 6\SeriesTextSource
Best regards,
Christopher Ireland
I'm looking a an example that works.
The example you suggested simply shows an open frame, and there is no way to add data to it.
Posted: Thu Nov 27, 2003 12:19 am
by Marc
Hello,
In the sample from the FAQ it should work if you comment out the aSeries.SetNumZValues line. (it worked here with that change).
At least it'll work as a TeeChart AX v3 and v4 project. ...To use it with later versions of TeeChart it'll need to be updated with the update utilities ..or rebuilt, then copy/pasting the code to the new project.
(See below for later versions)
eg.
Code: Select all
void CSurfaceDlg::FillSurface()
{
CString strSlider;
strSlider.Format("%d x %d", m_ctrlSlider.GetPos(), m_ctrlSlider.GetPos());
m_stSize.SetWindowText(strSlider);
// remove all surface points...
m_ctrlChart.GetSeries(0).Clear();
// This also makes a type check
CSurfaceSeries aSeries = m_ctrlChart.GetSeries(0).GetAsSurface();
// set initial surface size (rows x columns)
aSeries.SetNumXValues(m_ctrlSlider.GetPos());
//aSeries.SetNumZValues(m_ctrlSlider.GetPos());
// add surface points with a loop
int nMaxPoints = aSeries.GetNumXValues();
for(int x = 1; x <= nMaxPoints; x++)
{
for (int z = 1; z <= nMaxPoints; z++)
{
double d= nMaxPoints * 0.2;
aSeries.AddXYZ(x, 0.5 * cos(x / d)
+ cos(z / d), z, "", clTeeColor);
}
}
}
In version 5 the TeeChart Series property was changed to a method to make it compatible with Visual Studio.NET ...therefore all GetSeries(xx) become Series(xx). In this project there's a path problem (or other?) to the correct font source so I commented a font size change, maybe someone can find the cause.
I've updated the project to v6 and I'll put it on the attachments newsgroup:
[url]news://
www.berneda.com/steema.public.attachments[/url]
Regards,
Marc Meumann
Steema Support
Posted: Thu Nov 27, 2003 5:04 am
by 9078641
Thanks for the help, I would like to see the modfied example.
However I cannot access
news://
www.berneda.com/steema.public.attachments
The error message read "the newsgroup doe snot exisit on bernada.com" !
That's why I like this new forum at least I can acess it...
Is there anyway to get the file directly...?
Posted: Thu Nov 27, 2003 9:00 am
by Pep
Could you please check it again. I've just test it now and I can access.
Josep Lluis Jorge
http://support.steema.com
Posted: Thu Nov 27, 2003 8:36 pm
by 9078641
Pep wrote:Could you please check it again. I've just test it now and I can access.
Josep Lluis Jorge
http://support.steema.com
Does not work here...
Thi is the message I get from Netscape 7.1
http://hans-w.com/steema.jpg
Posted: Tue Dec 02, 2003 12:53 am
by Pep
Have you tried to access using Outlook Express or similar .. ?
If you still having problems, could you please tell me an email which I can use to send it to you directly ?
Josep Lluis Jorge
http://support.steema.com