Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: TFrame error No frames are available to insert

Tags:

delphi

tframe

It happened to me, that the Delphi XE6 IDE forgot all of the TFrame descendants that I created in the past.

More specifically, when I click on Standard -> Frames, the dialog for choosing my frames does not show anymore.

Instead, it shows the following error message:

No frames are available to insert. New frames may be created from the File|New|Other selections..

Is there a way to remedy the situation?

EDIT1 Steps to reproduce are sadly unavailable: I am honestly unsure how this happened, but it did. I think there was maybe a culprit when upgrading from certain versions of Delphi to another. As I did this upgrade multiple times over time, I remember starting the project in Delphi 7, then there were some versions which I don't remember which ones, the last two versions I used were XE2 and until now is XE6.


Edit2 This happens if the frame(s) was(were) created with a Delphi version before XE2.

like image 612
LinuxSecurityFreak Avatar asked Apr 27 '18 17:04

LinuxSecurityFreak


1 Answers

The reason for the problem is in changes to the .dproj file when the Firemonkey framework was added. To distinguish frames made for a vcl from frames made for fmx a line was added to the .dproj files as below. To make the correction to the .dproj file do as follows:

  1. Close the Delphi IDE.

  2. Open the .dproj file with a text editor of your choice.

  3. Look up the TFrame one by one.

  4. Let's suppose the following is your TFrame section:

    <DCCReference Include="Results.pas">
        <Form>FrameResults</Form>
        <DesignClass>TFrame</DesignClass>
    </DCCReference>
    
  5. The fix is to add the following line into that section:

        <FormType>dfm</FormType>
    

(in fmx projects the line is <FormType>fmx</FormType>)

like image 147
LinuxSecurityFreak Avatar answered Sep 19 '22 12:09

LinuxSecurityFreak