procedure PDllForm(Const Adllfile,amfunction:string);
var
mFunction:function(AHdle:integer;ALoginID,ADeptID,ADeptName,AUserName,APwd,ASocketIP,AModuleName,ALocalIP
char;APHdle:integer;ADHdle:integer):boolean;stdcall;//开放方法的声明
begin
mhandle:= LoadLibrary(pchar('../dlls/'+trim(adllfile)));
if mhandle<=0 then
begin
application.MessageBox(pchar('动态链接库'+adllfile+'加载失败。'+#13+'错误代码是:'+inttostr(getlasterror)),'动态连接库加载失败',mb_ok or mb_iconerror);
exit;
end;
@mFunction:=getprocaddress(mhandle,pchar(amfunction));
if @mfunction<>nil then
begin
mfunction(application.Handle,pchar(userinfo.loginid),pchar(userinfo.deptid),pchar(userinfo.deptname),pchar(userinfo.username),pchar(userinfo.userpwd),pchar(hostip),pchar('dddd'),pchar('127.0.0.1'),frm_appmain.Handle,mhandle);
end;
freelibrary(mhandle);
end;