Delphi: TFrame error No frames are available to insert
Asked Answered
G

4

11

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.

Gies answered 27/4, 2018 at 17:56 Comment(2)
I had this same issue with Delphi Rio 10.3, which at this time is the latest version of Delphi. Unfortunately, the fix suggested in the answer did not work to correct the problem.Hour
Correction. The fix mentioned in the answer did correct the problem. However, it was important that I added the <FormType> entry immediately below the <Form> entry. Note, also, I have no idea how the <FormType> element was removed from the .dproj file.Hour
G
29

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>)

Gies answered 27/4, 2018 at 17:56 Comment(1)
Your approach works most of the time, but sometimes you need to remove the unit of the frame from the project and reinsert again. I can see this issue also in Delphi 12.Kosse
P
1

I had this same issue; the frame contents were not updating correctly and after updating and removing frames a few times it broke. Under the project view I removed all the frames (Right Click remove from project) and added them again (Right Click on Project -> Add)

Pentlandite answered 23/10, 2022 at 12:6 Comment(0)
G
0

I had this happen; in my case it was far simpler.

I had one fmx project that had some frames and a vcl project that didn't in a single project group (different sub directories).

If I opened a fmx unit and tried to add a frame from the component menu, but had the vcl project as the compile target then I got this message. Changing the compile target to the application that contains the unit I opened and the collection of frames stopped the error.

Goingson answered 17/12, 2019 at 21:18 Comment(0)
C
0

There seems to be a bug in the IDE. Specifically, IDE offers IOTASourceEditor interface, which has CreateWriter method to obtain a IOTAEditWriter interface.

Some IDE extension may use methods of IOTAEditWriter interface to (for example) edit content of .dpr file (basically, just a series of .DeleteTo and .Insert is enough). Apparently this is somehow forces IDE to corrupt .dproj file.

Camaraderie answered 22/12, 2020 at 18:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.