关于dll中函数调用的问题
我编写的dll文件中包含一个4个参数的函数,在工程文件中动态调用dll中的该函数,传递4个参数,单数函数只能接收到最后一个参数,这是什么原因造成的!
如何解决?
调用函数的代码如下:
begin
Application.Initialize;
sqlcon := TADOConnection.Create(nil);
OneHandle := LoadLibrary('conn.dll'); //动态载入DLL,并返回其句柄
try
if OneHandle <> 0 then //如果载入成功则获取sqlconn函数的地址
connecting := GetProcAddress(OneHandle, 'sqlconnection');
if not (@connecting = nil) then
begin
sqlcon := connecting('127.0.0.1','yd','sa','sa');
ADOQuery1.Connection := sqlcon;
With ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from dhuser where yh_bianhao = :ls_yhbh');
Parameters.ParamByName('ls_dyhbh').Value := '030181' ;
Open;
if IsEmpty then
showmessage('数据记录集为空');
end;
end
else
showmessage('ssssss') ;
finally
FreeLibrary(OneHandle); //调用完毕收回DLL占用的资源
end;
end;
谢谢