Problem with frames: Error reading form: "Class TFrameBalance not found"
I'm maintaining an existing application and the developer has made almost all of the forms 'dynamic', in other words they are not declared in the DPR file, they are not 'Auto-Create' forms and they are not 'Available forms'.
So now my problem with frames:
I have a form e.g.
..\Balance\Forms\BalanceForm.pas
..\Balance\Forms\BalanceForm.dfm
It uses a frame:
..\Balance\Forms\BalanceFrame.pas
..\Balance\Forms\BalanceFrame.dfm
If I open the frame into the IDE *first*, and *then* open the form *second* I get no problem.
But if I open the form *first* I get error:
=================
Error Reading Form
Class TFrameBalance not found. Ignore the error and continue?
=================
This same problem exists throughout the application every time there is a form that uses frames.
Please help :S
Here is some code that will hopefully help:
..\Balance\Forms\BalanceForm.pas
unit BalanceForm;interfaceuses ... AuthResultFrame, BalanceFrame;type TFormBalance = class(TFormWizard) FrameAuthResult: TFrameAuthResult; FrameBalance: TFrameBalance; ... private ... public end;var FormBalance: TFormBalance;
I did try that... once.. and the problem persisted,
but in theory that solution makes sense.
Let me try it again.
To be clear, everything is in one big folder, however there are a lot of 'subfolders', so I am going to add each and every subfolder (there are probably about 40) to the library path and try again
rfwoolf
ASKER
Silly me, in this example I just need to add the folders for this FormBalance,
but the problem is persisting :S
Okay sure if i add them to the project, and therefore make them an 'available' form, the problem will go away, but the developer never did this and maybe this was for a good reason?
My boss wants me to get this application compiling on my laptop, preferably exactly like the developer had it - if I add all these frames (and there are probably quite a few) to the project, perhaps there will be a difference in memory or something like that?
epasquier>
It's so great to have your input on this one - I've done quite a bit of googling and saw different workarounds for this problem but they didn't seem to work and I had to wonder if I was doing something wrong.
One work around for example spoke about checking that in the DFM of the frame, you say *inherited* instead of *object* except for the 'base clase' ('base frame'). That's why I tried to paste all the 'original' source-code from the developer in case there's something amiss.
But like you say, the problem does appear to go away if you add the units to the project.
Yes, I'm using Delphi 7.
>>"if you open the form in the IDE, and inadvertently click OK on its error/question message about removing the component, you are screwed and will loose everything you might have changed in this frame components properties, and need to find a backup or redo it..."
--I'm not certain about this - I simply close the unit and choose not to save. This goes for any error you may get when opening a form and a class is missing, simply ignore / cancel and then close without saving.
Thanks for the helpful answer.
Emmanuel PASQUIER
> --I'm not certain about this - I simply close the unit and choose not to save.
> This goes for any error you may get when opening a form and a class is missing,
> simply ignore / cancel and then close without saving.
Yes, I concur, I made a shortcut in my mind. If you don't save, then you have no problems.
But since a while back I've been able to find a "temporary" workaround by opening the frame unit, then the form, and it works even without adding the frame to the project, there have been a time when I worked unsafely.
I have a few time forgot to open all the frames before the form, and clicked OK on the error, made changes in the code just because I needed to do it quickly, then leaved it at that, and forgot about the error and dfm modifications when the time came to save the project.... Not funny when the next day you reopen the project...
Oh and just FYI for anybody that reads this, its the updated Delphi 7, albeit it may be an 'old' update, I'm not sure if they released more than one
Emmanuel PASQUIER
And I think there is 95% chance that this problem is specific to Delphi 7 IDE.
I use also 5 and 2007, but less, for very specific reasons.
I am just not sure (5%) that this problem did not occurred with one of them.