Board index » cppbuilder » inherited forms - "Can't create form: base class not found"

inherited forms - "Can't create form: base class not found"


2006-09-27 05:09:26 PM
cppbuilder46
Hi there!
I've just encountered a strange behavior in BCB regarding inherited forms:
Originally I've had the following inheritance order:
TForm ->TMDIChild ->TRulesAnalysis
Since I intend to use the common capabilities of TRulesAnalysis for
other forms of that kind as well, I've added TCustomAnalysis and changed
the inheritance order as follows:
TForm ->TMDIChild ->TCustomAnalysis ->TRulesAnalysis
Now I'm encountering a error with the following meaning: "Can't create
form TRulesAnalysis : base class TCustomAnalysis not found"
However I've used the "Object gallery" (File ->New) to add a new form
that inherits from TCustomAnalysis which worked fine. Therefore I've
copied every line from that and just renamed the class names in dfm and
unit. Now both are identical except of their class names, but the
modified version of TRulesAnalysis still doesn't work.
For me this is somehow like a miracle since results of my work and the
wizard generated code are identical in their structure. So why should
one work and the other fail? Are there any settings and information
hidden that tell the IDE how to handle the inheritance of a form?
Thanks
//David
 
 

Re:inherited forms - "Can't create form: base class not found"

David Scheffel wrote:
Quote
For me this is somehow like a miracle since results of my work and the
wizard generated code are identical in their structure. So why should
one work and the other fail? Are there any settings and information
hidden that tell the IDE how to handle the inheritance of a form?
Maybe it has to do with the file order in the project file.
--
Regards,
Andreas Hausladen
 

Re:inherited forms - "Can't create form: base class not found"

I already checked that. Thanks god it does not.
Andreas Hausladen wrote:
Quote
David Scheffel wrote:

>For me this is somehow like a miracle since results of my work and the
>wizard generated code are identical in their structure. So why should
>one work and the other fail? Are there any settings and information
>hidden that tell the IDE how to handle the inheritance of a form?

Maybe it has to do with the file order in the project file.
 

{smallsort}

Re:inherited forms - "Can't create form: base class not found"

"David Scheffel" < XXXX@XXXXX.COM >wrote in message
Quote
Now I'm encountering a error with the following meaning: "Can't create
form TRulesAnalysis : base class TCustomAnalysis not found"
When that happens it is usually because the base form isn't open in the
editor or the package that it belongs to isn't part of the project group.
Try to have the base form(s) open in the editor before opening
TRulesAnalysis and see if that fixes the problem.
Quote
Are there any settings and information
hidden that tell the IDE how to handle the inheritance of a form?
There is one setting different in the DFM file. For forms that are
inherited directly from TForm the first word of the DFM will be "object".
For forms that are inherited from a form that inherits either from TForm or
another descendant then the first word of the DFM will be "inherited". The
same applies for TFrame and descendants.
- Clayton
 

Re:inherited forms - "Can't create form: base class not found"

Clayton Arends wrote:
Quote
"David Scheffel" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>Now I'm encountering a error with the following meaning: "Can't create
>form TRulesAnalysis : base class TCustomAnalysis not found"

When that happens it is usually because the base form isn't open in the
editor or the package that it belongs to isn't part of the project group.
Try to have the base form(s) open in the editor before opening
TRulesAnalysis and see if that fixes the problem.
Sorry, I can't confirm that. However I'm now using the wizard (object
gallery - inherit from) to rebuild those forms, which works. Well, I
hope it will keep on working since I still haven't found any difference
between the wizard generated code and mine:(
 

Re:inherited forms - "Can't create form: base class not found"

David,
If you are still monitoring this thread can you let me know if you are using
BDS2006 or BCB6 or earlier? In your post you wrote:
Quote
I've just encountered a strange behavior in BCB regarding inherited forms:
But I've witnessed something very suspiciously similar to the problem you
were having in BDS2006. To read my findings look for the post titled
"BDS2006: Discrepancy when adding existing unit/form to a package project"
on 9/28/2006 in this newsgroup.
- Clayton