为什么会出现exception eaccessviolation错误?

iamfly2000 2000-07-23 12:02:00
我有一段这样的程序:
procedure TForm1.DriveComboBox1Change(Sender: TObject);
var
flag:boolean;
drive:string;
fav1,tsp1:int64;
tfr1:plargeinteger;
fsp1,allsp1:string;
fsp2,allsp2:string;
begin
drive:=drivecombobox1.drive+':\';
flag:=getdiskfreespaceex(pchar(drive),fav1,tsp1,tfr1);
if flag then
begin
allsp1:=(formatfloat('###,##0',tsp1));
fsp1:=formatfloat('###,##0',fav1);
showmessage('所选磁盘总共容量为:'+allsp1+'字节');
allsp2:='所选磁盘总共容量为:'+allsp1+'字节';
edit1.Text:=fsp2;
label4.caption:=('所选磁盘总共容量为:'+allsp1+'字节');
label3.caption:='可用容量为:'+' MB ('+fsp1+'字节)';
showmessage('可用容量为:'+inttostr(fav1 div (1000000))+' MB ('+fsp1+'字节)');
end;
end;
然后在运行到edit1.text:=fsp2;这一行时开始出错(加上下面两行,label.caption:=),错误信息为:

exception eaccessviolation in module getdrvp.exe at 00049ee2.
access violation at address 00449ee2 in module 'getdrvp.exe'.read of address ffffffff.
为什么会出现这种错误呢?
...全文
582 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cita2000 2001-01-07
  • 打赏
  • 举报
回复
还用 pascal!不会把! 用delphi吧!
monkey79 2000-12-23
  • 打赏
  • 举报
回复
关注(E-mail to me )
monkey5258@china.com
OICQ:2385624
ffb 2000-07-26
  • 打赏
  • 举报
回复
Is Pascal?

6,847

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧