BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Abstract Error - Please help

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
rob kemp
Guest





PostPosted: Thu May 26, 2005 2:15 pm    Post subject: Abstract Error - Please help Reply with quote




Hi,

I got the following error when I execute my application (Abstract Error)
I googled on it and found some info that it's related to the
creation of TStrings at runtime.

As a matter of fact, my application creates strings (or labels) at runtime using:

TStaticText* text = new TStaticText(this);
//TLabel* text = new TLabel(this); // i tried this and nothing changed
text->Parent = this;
text->Color=clWhite;
text->Font->Size=10;
text->Top=10;
text->Left=100;

How can I solve this problem? has anyone seen this error before?
As indicated above, I replaced StaticText by Label and nothing really changed.

Thanks in advance for your help

Rob

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu May 26, 2005 4:45 pm    Post subject: Re: Abstract Error - Please help Reply with quote




"rob kemp" <NoSpam (AT) yahoo (DOT) com> wrote


Quote:
I got the following error when I execute my application (Abstract Error)

Where EXACTLY does the error occur? There is nothing abstract in the code
you have shown so far.


Gambit



Back to top
rob kemp
Guest





PostPosted: Fri May 27, 2005 2:34 pm    Post subject: Re: Abstract Error - Please help Reply with quote




Remy,

I chased the error and here is what I found.

What is creating the abstract error is the following:

- in my applications, I created lables at run time
and store the pointers in a TList, so the user can clear
them (make them invisible) when desired

TList *stList = new TList; //Create the list that stores the pointers

//Create labels at run time
TLabel* text = new TLabel(this);

text->Parent = this;
text->Color=clWhite;
text->Font->Size=8;
text->Caption="Text Here";
stList->Add(text); //add it to the list

//below is what causing the abstract error
// Make all the created labels invisible
if (stList->Count>0)
{
for (int i = 0; i < stList->Count; ++i)
{
TStaticText* st = static_cast<TStaticText*>(stList->Items[i]);
st->Visible=false;
st = NULL;
}
}

What's wrong with the code? how can I avoid the abstract error

thanks in advance


"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote:
Quote:

"rob kemp" <NoSpam (AT) yahoo (DOT) com> wrote in message
news:4295da05$1 (AT) newsgroups (DOT) borland.com...

I got the following error when I execute my application (Abstract Error)

Where EXACTLY does the error occur? There is nothing abstract in the code
you have shown so far.


Gambit




Back to top
JD
Guest





PostPosted: Fri May 27, 2005 3:24 pm    Post subject: Re: Abstract Error - Please help Reply with quote


"rob kemp" <NoSpam (AT) yahoo (DOT) com> wrote:
Quote:

[...] TLabel* text = new TLabel(this);

[...] TStaticText* st = static_cast<TStaticText*>(stList->Items[i]);

You allocate a TLabel and cast it TStaticText. They are not
the same.

~ JD


Back to top
Daniel Mayo
Guest





PostPosted: Fri May 27, 2005 3:49 pm    Post subject: Disabling TCheckboxes or TRadiobuttons when TGroupBox is dis Reply with quote

When a TGroupBox is disabled, any radioboxes or checkboxes within it are
disabled, but are not greyed out.. how can I get the radiobuttons and
checkboxes to grey out when their parent is disabled?

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.