Solved

THOSE ERROR MESSAGE ABOUT?

Posted on 2000-03-19
3
313 Views
Last Modified: 2006-11-17
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!

0
Comment
Question by:erichuang
  • 2
3 Comments
 
LVL 30

Expert Comment

by:Zoppo
Comment Utility
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
0
 

Accepted Solution

by:
amador earned 80 total points
Comment Utility
1 - the compilator cant find the obj TDBChat
2 - Consequence of 1
3 - He cant find the constructor TDBChart in obj TDBChart, if TDBChart is derived for TChart, put TChart:: before.
4 - He cant finda the function Picture in TDBChart, see 3
5 - Verify if Edit1 is declared, or if it is the name of the object really.
6 - Consequence of 1.

TChart::TDBChart *dbc= (TDBChart *) new TChart::TDBChart();

Test pointer before: if (dbc == NULL) return;

0
 
LVL 30

Expert Comment

by:Zoppo
Comment Utility
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
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Want to delete all my personal data 13 126
mixing C++ & C# in Vis Studio 2013 7 125
FMX enumerated colours 2 72
I could not build boost code, 10 50
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now