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中不一样。
求教。
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中不一样。
求教。
好象自定的结构就认为是不同的了
好象自定的结构就认为是不同的了 ??
有这等事 ? 应该不会吧。
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中定义的类型就可以用了,如果在工程文件中再次定义就会出现冲突。
type
PCustom = ^TCustom;
TCustom = record
Code : string;
Name : string;
end;
TCustomList = array of PCustom;