Link to home
Start Free TrialLog in
Avatar of erichuang
erichuang

asked on

THOSE ERROR MESSAGE ABOUT?

I JUST USE THE C++ BUILDER 4.0.
MY SOURCE IS:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TChart::TDBChart *dbc=new TDBChart();

dbc->Assign(DBChart1->Picture->Bitmap);

// TJPEGImage ¤º©wªºÀ£ÁY²v¬O90%
dbc->CompressionQuality=(short)Edit1->Text.ToInt();

dbc->SaveToBitmapFile("Test.bmp");

//±N¦sªºJPG¹ÏŪ¨ìImage2
// JPG->LoadFromFile("test.jpg");

// Image2->Picture->Bitmap->Assign(JPG);

delete dbc;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (CheckBox1->Checked)
   DeleteFile("Test.bmp");
}

THE ERROR MESSAGE IS:
[C++ Error] TEST.cpp(18): E2451 Undefined symbol 'TDBChart'.
[C++ Error] TEST.cpp(18): E2451 Undefined symbol 'dbc'.
[C++ Error] TEST.cpp(18): E2285 Could not find a match for 'TDBChart::TDBChart()'.
[C++ Error] TEST.cpp(20): E2316 'Picture' is not a member of 'TDBChart'.
[C++ Error] TEST.cpp(23): E2451 Undefined symbol 'Edit1'.
[C++ Error] TEST.cpp(32): E2158 Operand of 'delete' must be non-const pointer.
THOSE ERROR ABOUT WHAT?
THANK YOU!

Avatar of Zoppo
Zoppo
Flag of Germany image

Hi erichuang,

I found at least one failure:

If TDBChart is declared in namespace of TChart, then
TChart::TDBChart *dbc=new TDBChart();
should be:
TChart::TDBChart *dbc=new TChart::TDBChart();

this should solve the first three and the last error.

the other errors seem to be declaration errors.
Unfortunately I'm not experienced with C++ builder, so I don't know the TDBChart class at all...

ZOPPO
ASKER CERTIFIED SOLUTION
Avatar of amador
amador

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi amador,

some comments:

>if TDBChart is derived for TChart, put TChart:: before.
derived??? I would say TDBChart is declared in namespace TChart, i.e. a 'subclass' of TChart...

>He cant finda the function Picture in TDBChart
From the code I would say 'object Picture' instead of 'function Picture'

>TChart::TDBChart *dbc= (TDBChart *) new TChart::TDBChart();
why use that extra cast (which will not work until you cast to (TCart::TDBChart*)new... ), it's not needed

ZOPPO