紧急求助关于TIdHTTP在dll中调用问题?
function setjz(url:string;account:string;jz:double):string;export;stdcall;
var
aStream:TStringStream;
sparam:TStrings;
posturl,str1,str2:string;
IdHTTP1:TIdHTTP;
begin
astream:=TStringStream.Create('');
sparam:=tstringlist.Create;
idhttp1:=tidhttp.Create(nil);
try
str1:='account='+account;
sparam.Add(str1);
str1:='jz='+floattostr(jz);
sparam.add(str1);
posturl:=url+'/send.php';
sparam.Add(str1);
IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP1.Post(posturl, sparam, aStream); //Ìá½»
//str2:=idhttp1.AllData;
str2:=trim(astream.DataString);//»ñÈ¡½á
sparam.Free;
FreeAndNil(idhttp1);
astream.Free;
result:=str2;
except
FreeAndNil(idhttp1);
sparam.Free;
astream.Free;
result:='';
end;
end;
代码如上,在程序中调用本函数,第一次调用很正常,第二次调用就报错,调试发现错误出在
idhttp1:=tidhttp.Create(nil);这一句,我的delphi版本是D7,请大家帮忙解决一下,深表感谢