erichuang
asked on
THOSE ERROR MESSAGE ABOUT?
I JUST USE THE C++ BUILDER 4.0.
MY SOURCE IS:
void __fastcall TForm1::Button1Click(TObje ct *Sender)
{
TChart::TDBChart *dbc=new TDBChart();
dbc->Assign(DBChart1->Pict ure->Bitma p);
// TJPEGImage ¤º©wªºÀ£ÁY²v¬O90%
dbc->CompressionQuality=(s hort)Edit1 ->Text.ToI nt();
dbc->SaveToBitmapFile("Tes t.bmp");
//±N¦sªºJPG¹ÏŪ¨ìImage2
// JPG->LoadFromFile("test.jp g");
// Image2->Picture->Bitmap->A ssign(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!
MY SOURCE IS:
void __fastcall TForm1::Button1Click(TObje
{
TChart::TDBChart *dbc=new TDBChart();
dbc->Assign(DBChart1->Pict
// TJPEGImage ¤º©wªºÀ£ÁY²v¬O90%
dbc->CompressionQuality=(s
dbc->SaveToBitmapFile("Tes
//±N¦sªºJPG¹ÏŪ¨ìImage2
// JPG->LoadFromFile("test.jp
// Image2->Picture->Bitmap->A
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!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
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