简体   繁体   English

自定义控件发布的属性不存在

[英]Custom control published property does not exist

I have a custom control to which I am trying to add a property which can be set in the Object Inspector. 我有一个自定义控件,我试图向该控件添加可以在对象检查器中设置的属性。 According to this documentation , I need to place the property under the __published section of my header file. 根据此文档 ,我需要将该属性放置在头文件的__published部分下。

__published:
    __property  bool ShowErrorIcon = { read=FShowErrorIcon,write=FShowErrorIcon };

I set up the property to read and write to the private bool FShowErrorIcon 我将属性设置为读写私有布尔FShowErrorIcon

private:
    bool FShowErrorIcon;

However, when I launch the form that contains one of these controls I get the following error: 但是,当我启动包含这些控件之一的表单时,出现以下错误:

"Error reading RgnSearchBar.ShowErrorIcon: Property ShowErrorIcon does not exist." “读取RgnSearchBar.ShowErrorIcon时出错:属性ShowErrorIcon不存在。”

This is confusing me, because the property is clearly visible in the ObjectInspector when the control is selected. 这使我感到困惑,因为选择控件后,该属性在ObjectInspector中清晰可见。 What step am I missing here? 我在这里错过了哪一步?

You have an older version of the component binaries on your HDD. 您的HDD上具有较旧版本的组件二进制文件。 The version of the component that is loaded in the IDE is newer then the version that is getting linked into your executable. IDE中加载的组件版本比链接到可执行文件中的组件版本新。 Somewhere, an older version is on the search path before the newer version, so the compiler/linker is linking the old version. 在某个位置,较旧的版本位于较新版本之前的搜索路径中,因此编译器/链接器正在链接旧版本。 You need to find and remove that older version. 您需要找到并删除该旧版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM