Board index » cppbuilder » Property "XXX" Does not exist

Property "XXX" Does not exist

Hi All,

When loading a form from a streamed file, I am getting many messages of the
form
Property "xxx" does not exist. Because I've modified the form and certain
properties do indeed no longer exist.

Is there any way of getting the vcl to simply skip properties that are
obsolete. There ought to be some hook, that I can intercept?

Thanks

JB

 

Re:Property "XXX" Does not exist


Hi John!

"John Biddiscombe"  wrote

Quote
> When loading a form from a streamed file, I am getting many messages of
the
> form Property "xxx" does not exist. Because I've modified the form and
certain
> properties do indeed no longer exist.

You may wish to simply open the file (.dfm ?) in text mode and delete
the properties that no longer exist.
This should stop the behavior you are seeing.

Zack.

Re:Property "XXX" Does not exist


Quote
> You may wish to simply open the file (.dfm ?) in text mode and delete
> the properties that no longer exist.
> This should stop the behavior you are seeing.

The form was saved at run-time as part of a load/save state for a program.
The program can reload states from disk and version two has introduced
changes in the form design. Some saved properties are no longer available.
The saved form is part of a complex file and not a simple dfm so loading it
into the ide is not an option. Also users of version two will not have
access to BCB.

I've checked the vcl source and my only option seems to be to rebuild the
vcl and remove the raise line.

JB
PS. Anyone have any tips on rebuilding the vcl?

Re:Property "XXX" Does not exist


Hi John,

"John Biddiscombe" wrote

Quote
> The form was saved at run-time as part of a load/save state for a program.

How was the form saved?
with WriteComponent()? using your own parsing?
in binary? or text?

Quote
> The program can reload states from disk and version two has introduced
> changes in the form design. Some saved properties are no longer available.

Using WriteComponent() and ReadComponent() here would be perfect...
But - your users are already tied to whatever method you used to save
thier version 1 files.

*If* you are using WriteComponent/ReadComponent to read and write
your forms states - you would override DefineProperties() for your forms
class. Thereby - you could also provide (empty) methods for reading in
the obsolete properties.

Another idea is to have your version2 form class separate from the ver1
class, try to load the dfm into an instance of ver2 first, if an
exception is thrown - try to load it into an instance of ver1. If success
- copy all your non-obsolete properties into your ver2 form.

Regardless - you should at least be able to catch exceptions thrown from
the reader method. At least providing default error handling.

Quote
> The saved form is part of a complex file and not a simple dfm so loading
> it into the ide is not an option.
> Also users of version two will not have
> access to BCB.

I see - the "dfm's" are distributed at users sites already...

Quote
> I've checked the vcl source and my only option seems to be to rebuild the
> vcl and remove the raise line.

Wow - that seems drastic.
Bashing at the VCL to overcome a minor shortcoming in your program
seems a bit - umm... backward. I know the VCL has bugs - but thats not
one of them. But Im sure you could rebuild it - no problems at all.
<g>
;)

Zack.

Re:Property "XXX" Does not exist


Quote
> *If* you are using WriteComponent/ReadComponent to read and write
> your forms states - you would override DefineProperties() for your forms
> class. Thereby - you could also provide (empty) methods for reading in
> the obsolete properties.

This idea I like. a Dummy define properties is a nice way of catching them.

Quote

> Regardless - you should at least be able to catch exceptions thrown from
> the reader method. At least providing default error handling.

Alas. The exception is thrown inside readcomponent and not caught until
outside the main property reading loop. If I catch it ouside, I lose all
proerties "after" the one that is bad.

Quote
> Wow - that seems drastic.
> Bashing at the VCL to overcome a minor shortcoming in your program
> seems a bit - umm... backward. I know the VCL has bugs - but thats not
> one of them. But Im sure you could rebuild it - no problems at all.

I would only need to comment out a single raise line. Any idea where I can
find makefiles for the vcl, I'm not sure which files to put in which
packages...

JB

Other Threads