各位,请教个问题dll
我的DLL传过去的integer参数怎么变成了0;1、delphi DLL编码:
function spdz(const gnbm,ggljzfc,sjkljzf,djbm,tjr,tjrxm:pchar;const spfs:integer):boolean;stdcall;
var
ado1,ado2,ado3,ado4:Tadodataset;
gnbm1,ggljzfc1,sjkljzf1,djbm1,tjr1,tjrxm1,rqzd,rqzdz:string;
adq1:Tadoquery;
str1,zybglzd,cybglzd,bdbhzd,bdbmlx,glzdlx:string;
i:integer;
jgzjz,sfzs:boolean;//函数返回值的中间值
djg,djg1:integer;
rqsz:array of string;
splx1:integer;
begin
//锁定记录
gnbm1:=gnbm;
ggljzfc1:=ggljzfc;
sjkljzf1:=sjkljzf;
djbm1:=djbm;//这个参数变成了0,我传的是1;
.....
end;
2、调用DLL的语句:
......
type
Ttpspdz=function(gnbm,ggljzfc,sjkljzf,djbm,tjr,tjrxm:pchar;spfs:integer):boolean;stdcall;
......
Th:=LoadLibrary('./syslib/D9999.dll');
if Th>0 then
try
Tp:=GetProcAddress(Th,PChar('tjsp'));
if Tp<>nil then begin
Tf2:=Ttpspdz(Tp);
spjg:=tf2(pchar('P'+copy(trim(self.name),2,6)),pchar(ggljzc),pchar(yyztlj),pchar(trim(listview1.Selected.SubItems[1])),pchar(trim(userid)),pchar(trim(username)),1);//这儿传的是1
end
else begin
ShowMessage('ljzc函数没有找到');
FreeLibrary(Th);
end;
finally
FreeLibrary(Th);
end
else begin
ShowMessage('D9999.dll没有找到');
FreeLibrary(Th);
end;