读书人

dll有关问题,简单

发布时间: 2012-03-08 13:30:13 作者: rapoo

dll问题,简单
library firdll;

uses
SysUtils,
Classes,
Un in 'Un.pas';

{$R *.res}

begin
end.


unit Un;

interface

uses Windows, Messages, Dialogs, SysUtils;

var
function fu:bool;stdcall; //identifier expected but 'function' found;

implementation //type expected but 'implemention' found

function fu:integer;

begin
result:=0;
end;

end.

多谢

[解决办法]
function fu:bool;stdcall; //identifier expected but 'function' found;

implementation //type expected but 'implemention' found

function fu:integer;
函数返回值不相同 ,
[解决办法]

1:
var
function fu:bool;stdcall; //identifier expected but 'function' found;

var 是用来定义变量的,你没有定义变量这个var就不需要了

2:
function fu:integer;
begin
result:=0;
end;

函数声明不一致,改成
function fu:bool;stdcall;
begin
result:=false;
end;

读书人网 >.NET

热点推荐