请教静态的链接动态链接库,退出程序时出错?当我一按Button1时程序自动退出,调试时说写内存错误!
implementation
function PrepareModify(answerfilename:pchar;TotalMark:single):integer;
stdcall;external 'Read2.dll' name 'PrepareVBModify';
function ReadModify(sourcefilename:pchar;SubjectNumber:integer):single;
stdcall;external 'Read2.dll' name 'ReadVBModify';procedure TForm1.Button1Click(Sender: TObject);
var
p:integer;
count:single;
begin
count:=0;
p:=PrepareModify('D:\1.26\阅卷系统\VBM.ans',20);
if p=1 then
begin
count:=ReadModify('D:\1.26\阅卷系统\MODIFY.BAS',1);
label1.Caption:=floattostr(count);
end;
end;
implementation
function PrepareModify(answerfilename:pchar;TotalMark:single):integer;
stdcall;external 'Read2.dll' name 'PrepareVBModify';
function ReadModify(sourcefilename:pchar;SubjectNumber:integer):single;
stdcall;external 'Read2.dll' name 'ReadVBModify';procedure TForm1.Button1Click(Sender: TObject);
var
p:integer;
count:single;
begin
count:=0;
p:=PrepareModify('D:\1.26\阅卷系统\VBM.ans',20);
if p=1 then
begin
count:=ReadModify('D:\1.26\阅卷系统\MODIFY.BAS',1);
label1.Caption:=floattostr(count);
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货