在线等待大家的答案,希望高手能看看!
下面是我做的一个DLL,build有问题:
[Error] dllcomserver.dpr(10): Undeclared identifier: 'Interger'
[Error] dllcomserver.dpr(23): Declaration of 'max' differs from previous declaration
[Warning] dllcomserver.dpr(25): Comparing signed and unsigned types - widened both operands
[Error] dllcomserver.dpr(31): Declaration of 'mix' differs from previous declaration
[Warning] dllcomserver.dpr(33): Comparing signed and unsigned types - widened both operands
//文件中的代码
library dllcomserver;
uses
SysUtils,
Classes;
type
TComp=Class
public
function max(x,y:Interger):Integer;virtual;abstract;
function mix(x,y:Interger):Integer;virtual;abstract;
end;
type
TCompImpl=Class(TComp)
public
function max(x,y:Interger):Integer;override;
function mix(x,y:Interger):Integer;override;
end;
{TCompImpl}
function TCompImpl.max(x,y:Integer):Integer;
begin
if x>y then
result:=x
else
result:=y;
end;
function TCompImpl.mix(x,y:Integer):Integer;
begin
if x<y then
result:=x
else
result:=y;
end;
function CreateCompImpl:TCompImpl;stdcall;
begin
result:=TCompImpl.Create;
end;
function add(x,y:Interger):Interger;stdcall;
begin
result:=x+y;
end;
function multi(x,y:Interger):Interger;stdcall;
begin
result:=x*y;
end;
exports
add,multi,CreateCompImpl;
begin
end.