Updating a custom component -- losing properties

From: Billw (notarealemail_at_nowhere.com)
Date: 08/26/04


Date: Thu, 26 Aug 2004 15:10:40 -0400

Are there any component writing experts reading here?

I have a custom component I developed a few years ago, and have used it
extensively in an application.
Recently I modified the component, adding a new property to better define
its behaviour under different circumstances. I reinstalled the new
component, and recompiled my application, but now the application is
sometimes not saving the values for one of the old properties.

The unit used to have these properties (along with many others):
MinValue: double
MaxValue: double

I recently added a new property: MinMag: double.

The properties all show up in the property inspector. But in at least one
of the instances on a form in my application, the MinValue and the MinMag
properties are not being set to the values in the inspector (that is, both
properties stay at their default values). If I look at the ".dfm" file for
the form, the dfm shows no entry for these two properties at all for that
instance. If I edit the dfm file to add these, and then save it, it always
takes them back out!

Strangely, other instances of the same component on the same form DO show
the "MaxValue" entry, though. (But none of them have the "MinMag" property.

So, when I add new properties to an already-used component, how do I get the
new properties to work with an application developed with an older version
of the component? And how do I keep it from "losing" properties that were
there originally?

Thanks



Relevant Pages

  • Re: dfm file mysteries
    ... You are asking technical questions in a non-technical newsgroup. ... The DFM stores whatever the actual property value is at the time the DFM is ... The .dfm file seems to get saved every time the .pas file gets ...
    (borland.public.delphi.non-technical)
  • Re: Unsupported 16 bit resource error when compiling
    ... dosen't finish or a integer replaced by a stange string. ... I had a dfm file that Delphi could no longer open at all, ...
    (alt.comp.lang.borland-delphi)
  • Unsupported 16 bit resource error when compiling
    ... I always set text-file dfm format as default, but this time, for some ... this particular form has been saved in stream-format. ... On saving the dfm file, Delphi was then able to work with it as normal. ...
    (alt.comp.lang.borland-delphi)
  • Re: Unsupported 16 bit resource error when compiling
    ... See the content of your DFM. ... this particular form has been saved in stream-format. ... On saving the dfm file, Delphi was then able to work with it as normal. ...
    (alt.comp.lang.borland-delphi)