gpt4 book ai didi

activex - Lazarus/FPC 中的接口(interface) : Multiple inheritance

转载 作者:行者123 更新时间:2023-12-02 14:14:23 26 4
gpt4 key购买 nike

我正在尝试创建一个 shell 扩展来为 Windows 资源管理器“infotips”中的 JPEG 文件提供 EXIF 信息,并且正在使用 Lazarus,因为这需要生成 x64 DLL。

Lazarus 是否支持接口(interface)的多重继承?如果支持,我该如何处理?

例如,类似:

type
IInfoTips = interface(IPersistFile, IQueryInfo)

谢谢, 标记

最佳答案

不,FPC 中的接口(interface)尚不支持多重继承。

你可以做的是让实现类继承两个接口(interface):

type
TMyInfoTips = class(TInterfacedObject, IPersistFile, IQueryInfo)

但不是在界面级别,如您所愿。这样的语句不会编译:

type
IInfoTips = interface(IPersistFile, IQueryInfo)

您只能从单个接口(interface)类型“继承”。

Delphi 也不支持它。仅已不复存在的Delphi for .Net compiler做了...但是因为 .Net/C# IR 支持(并期望)该功能。

我在 Delphi 或 FPC 中也缺少此功能。

关于activex - Lazarus/FPC 中的接口(interface) : Multiple inheritance,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9982483/

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