Delphi DCC发布错误,字段非类或接口类型,如何解决?
- 内容介绍
- 文章标签
- 相关推荐
本文共计276个文字,预计阅读时间需要2分钟。
TGroup = class name:string[32]; <<<======================== rwFeatures:TFeatures; roFeatures:TFeatures; levels:TLevels; private public constructor Create; procedure Read(var f:file); procedure ReadOld(var f:file); procedure Write(var f:file); end;
这是什么意思?
在启用 Emit runtime type information设置的情况下编译该类.使用运行时类型信息编译类时,将发布默认可见性.这意味着发布了短字符串字段.并且不允许发布短字符串字段.documentation说:
Fields can be published only if they are of a class or interface type.
这是一个非常严格的要求.例如,这意味着您无法发布整数或布尔字段.
我怀疑这种限制是因为已发布字段的主要用途是对象引用.想一想表单上的组件.
使用以下选项之一解决问题:
>不要为此类发出运行时类型信息.>将短字符串字段设为公开而不是发布.>使用属性而不是字段.
本文共计276个文字,预计阅读时间需要2分钟。
TGroup = class name:string[32]; <<<======================== rwFeatures:TFeatures; roFeatures:TFeatures; levels:TLevels; private public constructor Create; procedure Read(var f:file); procedure ReadOld(var f:file); procedure Write(var f:file); end;
这是什么意思?
在启用 Emit runtime type information设置的情况下编译该类.使用运行时类型信息编译类时,将发布默认可见性.这意味着发布了短字符串字段.并且不允许发布短字符串字段.documentation说:
Fields can be published only if they are of a class or interface type.
这是一个非常严格的要求.例如,这意味着您无法发布整数或布尔字段.
我怀疑这种限制是因为已发布字段的主要用途是对象引用.想一想表单上的组件.
使用以下选项之一解决问题:
>不要为此类发出运行时类型信息.>将短字符串字段设为公开而不是发布.>使用属性而不是字段.

