VC++ example "Surface" does not work!

TeeChart for ActiveX, COM and ASP
Post Reply
hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

VC++ example "Surface" does not work!

Post by hansw » Tue Nov 18, 2003 5:48 am

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.
:wink:

Pep
Site Admin
Site Admin
Posts: 3272
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Nov 18, 2003 10:34 am

Hi,

which example are you referencing ?

Best Regards !
Josep Lluis Jorge
http://support.steema.com

hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

Post by hansw » Tue Nov 18, 2003 2:52 pm

Pep wrote:Hi,

which example are you referencing ?

Best Regards !
Josep Lluis Jorge
http://support.steema.com
The project is in surface.zip under Examples: VC++

Pep
Site Admin
Site Admin
Posts: 3272
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Nov 19, 2003 11:11 am

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

hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

Post by hansw » Wed Nov 19, 2003 4:15 pm

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.

Pep
Site Admin
Site Admin
Posts: 3272
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Nov 25, 2003 4:06 pm

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

hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

Same problem

Post by hansw » Wed Nov 26, 2003 4:55 am

Pep wrote: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
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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Wed Nov 26, 2003 10:47 am

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

hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

Post by hansw » Wed Nov 26, 2003 7:50 pm

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.

Marc
Site Admin
Site Admin
Posts: 1209
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Thu Nov 27, 2003 12:19 am

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

hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

Post by hansw » Thu Nov 27, 2003 5:04 am

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...?

Pep
Site Admin
Site Admin
Posts: 3272
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Nov 27, 2003 9:00 am

Could you please check it again. I've just test it now and I can access.

Josep Lluis Jorge
http://support.steema.com

hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

Post by hansw » Thu Nov 27, 2003 8:36 pm

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

Pep
Site Admin
Site Admin
Posts: 3272
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Dec 02, 2003 12:53 am

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

Post Reply