Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is typically an error during the streaming of a .DFM. Usually this error occurs with TLabel components because many folks remove the TLabel fields from the form or frame in order to cut down on the clutter and reduce the instance size of the form. The common and confusing mistake they make, however, is that in their over-zealousness, they remove <strong>all</strong> TLabel references. That is when bad things start to happen. Let me run down how the streaming system locates a component's class.</p> <p>Remember that the class reference in the .DFM is <em>just a string</em>. The streaming system has to convert this string into a class reference (TComponentClass). There are two mechanisms that the streaming system uses to do this. The first one is very simple and involves a global list of class references. You can call RegisterClass or RegisterClasses to explicitly make the streaming system aware of it. The second is much more subtle and not very well known; in fact it is all part of the "magic" of Delphi :-). When the compiler builds the form, all the fields that represent the components on the form are processed and an internal table is built as part of the RTTI or metadata for the form/frame/datamodule itself. This table contains a list of references to all the individual component types represented by the component fields. So even if a component is <strong>not</strong> in the global list, it can still be found by scanning through this compiler generated table. That is what the Classes.TReader.GetFieldClass() method does.</p> <p>Back to my TLabel example, this problem is easily fixed by simply ensuring that <em>at least one of a given component type has a field.</em> So as long as there is at least field of type TLabel, <strong>all</strong> the other TLabels will load just fine. So in your case, make sure the TListView or TImage fields haven't been deleted.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload