gpt4 book ai didi

delphi - 从 GetPropValue 获取接口(interface)

转载 作者:行者123 更新时间:2023-12-03 15:50:58 27 4
gpt4 key购买 nike

我想从对象实例动态获取属性值。我能够获取类属性、序数类型和字符串。 GetPropValue 的 delphi 源代码不支持 tkInterface。有没有办法使用属性信息获取接口(interface)。顺便说一句,所有公开的属性都是已发布的属性。

暂时,我使用 TObject 作为返回类型。 GetPropValue 返回对象实例的地址。我将其类型转换为 TObject 并返回结果。

最佳答案

如果我理解正确,你想使用 GetInterfaceProp()功能。用法与 GetPropValue() 相同,但它返回一个 IInterface,您可以使用 ie Supports() 将其“转换”为正确的类型。 .

关于delphi - 从 GetPropValue 获取接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7379042/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com