首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >升级到Delphi10.4悉尼时缺少ToolsAPI接口方法的实现

升级到Delphi10.4悉尼时缺少ToolsAPI接口方法的实现
EN

Stack Overflow用户
提问于 2020-07-23 14:54:09
回答 1查看 474关注 0票数 2

我已经在一个新的虚拟机中安装了Delphi 10.4悉尼w/修补程序2,并将Delphi10.3东京源代码复制到它。

在重新构建可视化工具(用于DevExpress TcxSchedulerEvents)时,我会得到以下错误:

dcc32 Error EventVisualizr.pas(19):接口方法IOTAThreadNotifier.EvaluateComplete的E2291缺失实现

我只删除了编译后的包cxLibraryRS26cxSchedulerRS26dxCoreRS26dxGDIPlusRS26,并添加了cxLibraryRS27cxSchedulerRS27dxCoreRS27dxGDIPlusRS27 --没有其他代码更改:

我在TEventViewerFrame类型定义的第一行中得到了错误:

代码语言:javascript
复制
unit EventVisualizr;
// Copied and modified from TStringListVisualizer. Shows values for TcxSchedulerEvent properties:
// - ID
// - Caption
// - Custom property tt_fromdate (if it exists)
// - Custom property tt_todate (if it exists)
// - Start
// - Finish

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ToolsAPI, Vcl.ExtCtrls;

type
  TAvailableState = (asAvailable, asProcRunning, asOutOfScope, asNotAvailable);

  TEventViewerFrame = class(TFrame, IOTADebuggerVisualizerExternalViewerUpdater, IOTAThreadNotifier, IOTAThreadNotifier160)
    EventListView: TListView;
    procedure EventListViewData(Sender: TObject; Item: TListItem);
  private
    FOwningForm: TCustomForm;
    FClosedProc: TOTAVisualizerClosedProcedure;
    FNotifierIndex: Integer;
    FCompleted: Boolean;
    FDeferredResult: string;
    FDeferredError: Boolean;
    FPropValues,
    FPropNames: TStrings;
    FAvailableState: TAvailableState;
    function Evaluate(Expression: string): string;
  protected
    procedure SetParent(AParent: TWinControl); override;
  public
    procedure CloseVisualizer;
    procedure MarkUnavailable(Reason: TOTAVisualizerUnavailableReason);
    procedure RefreshVisualizer(const Expression, TypeName, EvalResult: string);
    procedure SetClosedCallback(ClosedProc: TOTAVisualizerClosedProcedure);
    procedure SetForm(AForm: TCustomForm);
    procedure AddEventItems(const Expression, TypeName, EvalResult: string);

    { IOTAThreadNotifier }
    procedure AfterSave;
    procedure BeforeSave;
    procedure Destroyed;
    procedure Modified;
    procedure ThreadNotify(Reason: TOTANotifyReason);
    procedure EvaluteComplete(const ExprStr, ResultStr: string; CanModify: Boolean;
      ResultAddress, ResultSize: LongWord; ReturnCode: Integer);
    procedure ModifyComplete(const ExprStr, ResultStr: string; ReturnCode: Integer);

    { IOTAThreadNotifier160 }
    procedure EvaluateComplete(const ExprStr, ResultStr: string; CanModify: Boolean;
      ResultAddress: TOTAAddress; ResultSize: LongWord; ReturnCode: Integer);
  end;

ToolsAPI.pas中,两者都有一个EvaluateComplete定义,但在该源文件中没有实现:

代码语言:javascript
复制
IOTAThreadNotifier = interface(IOTANotifier)
  ['{34B2E2D7-E36F-11D1-AB0E-00C04FB16FB3}']
  { This is called when the process state changes for this thread }
  procedure ThreadNotify(Reason: TOTANotifyReason);
  { This is called when an evaluate that returned erDeferred completes.
    ReturnCode <> 0 if error }
  procedure EvaluateComplete(const ExprStr, ResultStr: string; CanModify: Boolean;
    ResultAddress, ResultSize: LongWord; ReturnCode: Integer);
  { This is called when a modify that returned erDeferred completes.
    ReturnCode <> 0 if error }
  procedure ModifyComplete(const ExprStr, ResultStr: string; ReturnCode: Integer);
end;

IOTAThreadNotifier160 = interface(IOTAThreadNotifier)
  ['{46F94C52-E225-4054-A5F0-F5E67E29B2C2}']
  { This is called when an evaluate that returned erDeferred completes.
    ReturnCode <> 0 if error }
  procedure EvaluateComplete(const ExprStr, ResultStr: string; CanModify: Boolean;
    ResultAddress: TOTAAddress; ResultSize: LongWord; ReturnCode: Integer); overload;
end;

在比较ToolsAPI文件时,我看到:

  • 它在10.3被命名为EvaluteComplete (缺失'a'),它已经被修正为EvaluteComplete IOTAThreadNotifier160.EvaluateComplete,现在得到一个重载指令(当然,与我认为的问题无关)

改名会是原因吗?10.3版本中的EvaluateComplete过程也没有“实现”(从我对接口的了解来看,这似乎还不错)。

Why do I get the error Missing implementation of interface method in Delphi XE2?Why do I get error Missing implementation?中,我了解出现错误的原因可能是参数列表不同,但在这种情况下,我不知道在哪里查找正确的参数列表。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-07-24 14:30:06

您的TEventViewerFrame仍然包含“旧”EvaluteComplete的实现。

通过简单地将TEventViewerFrame.EvaluteComplete重命名为TEventViewerFrame.EvaluateComplete (以满足新的接口契约)来修复它。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63057132

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档