library Project1;uses
  SysUtils,
  Classes,
  dialogs,
  Unit1 in 'Unit1.pas';type
  PCustom = ^TCustom;
  TCustom = record
    Code : string;
    Name : string;
  end;
  TCustomList = array of PCustom;
type
  TMyCustom = class(TInterfacedObject,ICustom)
    procedure Init(Value : TCustomList);
  end;{$R *.res}procedure TMyCustom.Init(Value : TCustomList);
begin
end;begin
end.//********************************************************
unit Unit1;interfacetype
  PCustom = ^TCustom;
  TCustom = record
    Code : string;
    Name : string;
  end;
  TCustomList = array of PCustom;type
  ICustom = interface
    ['{0AEF2634-6161-4B50-9ABF-F28D5249EC56}']
    procedure Init(Value : TCustomList);
  end;
implementationend.提示说library中定义的Init和ICustom中不一样。
求教。

解决方案 »

  1.   

    增加   procedure test(Value : string);可以通过
    好象自定的结构就认为是不同的了
      

  2.   

    增加   procedure test(Value : string);可以通过
    好象自定的结构就认为是不同的了  ??
     有这等事 ? 应该不会吧。
      

  3.   

    library Project1;uses
      SysUtils,
      Classes,
      dialogs,
      Unit1 in 'Unit1.pas';type 
      TMyCustom = class(TInterfacedObject,ICustom)
        procedure Init(Value : TCustomList);
      end;{$R *.res}procedure TMyCustom.Init(Value : TCustomList);
    begin
    end;begin
    end.//********************************************************
    unit Unit1;interfacetype
      PCustom = ^TCustom;
      TCustom = record
        Code : string;
        Name : string;
      end;
      TCustomList = array of PCustom;type
      ICustom = interface
        ['{0AEF2634-6161-4B50-9ABF-F28D5249EC56}']
        procedure Init(Value : TCustomList);
      end;
    implementationend.既然已经引用了Unit1,那么Unit1中定义的类型就可以用了,如果在工程文件中再次定义就会出现冲突。
      

  4.   

    呵,你试试不就知道了。反正只要COPY一下
      

  5.   

    不是吧,你把你library Project1里面定义的这个结构删了,再试试。
    type
      PCustom = ^TCustom;
      TCustom = record
        Code : string;
        Name : string;
      end;
      TCustomList = array of PCustom;