3
votes

My program written with Delphi 7 compiles OK, but when I run it it gives me the error message:

Project1.Exe raised exception class EReadError with Message 'Property Persistence does Not Exist'. Process Stopped.

This only started after I installed the TMS Component Pack to use with this project. Thanks for any help.

6
We're going to need to see some code for that one.David Brown
Try opening up all forms in design mode and just saving them, see if that helps.Lasse V. Karlsen

6 Answers

7
votes
  1. Open the Form in Delphi IDE
  2. Use Alt + F12 to edit the .DFM source
  3. Search the "Persistence" property
  4. Delete the line with "Persistence" property

DFM example:

SomeComponent1 = TSomeComponent
  OtherProperty = OtherValue
  Persistence = True
  AnotherProperty = AnotherValue
end

Also you can use the great DFMCheck 1.4 tool, by Andreas Hausladen. To check any other missing property like that:

http://andy.jgknet.de/blog/?page_id=177

This is most likely caused by the compiled & installed package being out of sync with the actual .pas file. If you have source code then rebuilding the packages will probably fix it.

0
votes

Set a breakpoint(F5) and step the program(F7/F8).Get to the location where you get that exception and then give us more information about it(show some code).

0
votes

This error means that it's trying to load something (usually a form) from a DFM resource and it comes up with a value for a property that the component it's creating doesn't have.

If it only happened when you started using TMS components, the solution is simple: don't use them. Send as much information as you can about the error and the project that caused it to the authors and see if they can find a way to fix it. Until then, use something else.

0
votes

If you're using text DFMs (right click on the form, check "Text DFM", save), you can use Search|Find in Files to find all instances of Persistence in your DFM files. Just set the search string to "Persistence" (I usually tell it to ignore case), the file mask to "*.dfm", and check the "All files in project" checkbox.

If you're not already using text DFMs and don't want to manually open all forms and check the box and then resave them, you can use CONVERT.EXE (in the ($DELPHI)\Bin folder) to convert them en-masse. Run CONVERT with no parameters from any command prompt to see the options. By default, CONVERT will save .DFM as .txt, but you can have it work in-place (rewriting the binary .DFM as the text .DFM) by using the -i switch. (I usually back up the .DFMs to a different folder first, then convert them. If no errors are reported, I can then delete the backed up .DFMs later.)

0
votes

I had similar problem with TMS when I upgraded to a new version:

If you think that some particular component is causing the problem, delete it , compile project without it, place it on the form/frame again.

If that doesn't work for you:

Things you need to do in order to fix the problem , so you can use Designer and new properties, because that's what you really want , don't you ? :-) :

  • Uninstall TMS Component Pack ( or whatever you're using )
  • Re-Install TMS Component Pack
  • Build & Install the packages
  • Add appropriate TMS .lib files to your Application Project ( I'm using C++ Builder )
  • Add appropriate TMS .pas files to your Application Project . For example I had a problem with TAdvSmoothCalendar component , so I've added the AdvSmoothCalender.pas to my project.

Cheers! I hope it works for everyone with a similar problem :)

0
votes

I had similar problem with nuiGui Delphi Framework, To Solve this, create a include file with some properties and use it in your class.

/// include class 'Basic.inc'
private
   function GetWidth: Integer;

published
   property ClientHeight : Integer Read FHeight Write FHeight;
 //property ClientWidth  : Integer Read FWidth Write FWidth;
 //property OldCreateOrder : Boolean Read FOldCreateOrder Write FOldCreateOrder;
 end;
...

/// main class like this
TuMemoFrame = class(TUniFrame)
  UniMemo1: TUniMemo;
  UniMemo2: TUniMemo;
  UniButton1: TUniButton;
  procedure UniButton1Click(Sender: TObject);
private
public

{$Include Basic.inc } // <---
end;