Creating series at runtime

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Torben Laursen
Newbie
Newbie
Posts: 4
Joined: Fri Sep 10, 2004 4:00 am

Creating series at runtime

Post by Torben Laursen » Fri Sep 10, 2004 12:13 pm

Hi

I have updated from version 6 to version 7 for c++ builder 6 and now my code gives me AV's

example: create a serie at runtime and set Pointer->Visible to false:

TPoint3DSeries *Serie = new TPoint3DSeries(Chart);
Serie->Pointer->Visible = false; /// <- this line give me an AV
Serie->YValues->Order = loNone; ///<- and this one

and so on.
But as I can tell this code should run without any problems, so can
anyone please tell me what I'm duing wrong.

Thanks Torben

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Fri Sep 10, 2004 12:22 pm

Hi, Torben.

The code looks fine to me and I was also able to run in on my machine here. I suspect the problem is your BCB project is still referencing old bpi/lib/obj files. There are several topics in this forum about "old files" problem. Just type the keywords "bpi old" at forum search form and check the results.
Marjan Slatinek,
http://www.steema.com

Torben Laursen
Newbie
Newbie
Posts: 4
Joined: Fri Sep 10, 2004 4:00 am

Post by Torben Laursen » Fri Sep 10, 2004 1:55 pm

Hi Marjan

Yes a search and kill did the job, but that has just given me a new problem
I have a custom chart derived from TChart:
*.h file
class PACKAGE TEChart : public TChart
*.cpp file
static inline void ValidCtrCheck(TEChart *)
{
new TEChart(NULL);
}
//---------------------------------------------------------------------------
__fastcall TEChart::TEChart(TComponent* Owner)
: TChart(Owner)
{
}
//---------------------------------------------------------------------------
namespace Echart
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TEChart)};
RegisterComponents("EqPack", classes, 0);
}
}
//---------------------------------------------------------------------------


But when I try to compile it I get these errors:
[C++ Error] EChart.cpp(16): E2352 Cannot create instance of abstract class 'TEChart'
[C++ Error] EChart.cpp(16): E2353 Class 'TEChart' is abstract because of '_fastcall TCustomAxisPanel::IsFreeSeriesColor(TColor,bool,TChartSeries *) = 0'

I also have a component derived from TTeeCommander:
*.h file
#include "TeeComma.hpp"
class PACKAGE TETeecommander : public TTeeCommander
{
void __fastcall B_Load_Click(TObject *Sender);
}
*.cpp file
Where I add 1 buttom of my own:
B_Load_ = this->CreateButton(310, B_Load_Click, "Open", "", 0);

That gives me the error:
[C++ Error] ETeecommander.cpp(27): E2285 Could not find a match for 'TCustomTeeCommander::CreateButton(int,void,char *,char *,int)'

As far as I can tell CreateButton is defined in TeeComma.hpp

Thanks Torben

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

Post by Pep » Tue Sep 14, 2004 8:56 am

Hi Torben,

see the answer of my colleague Marjan here

Post Reply