DELPHI7开发的程序出现EAccessViolation错误是怎么回事啊?
代码如下unitJS110Unit;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Co...
代码如下
unit JS110Unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, PublicUnit, jpeg, ExtCtrls, StdCtrls, Grids, DBGrids;
type
TJS110Form = class(TPublicUnit)
Panel1: TPanel;
Panel2: TPanel;
DBGrid1: TDBGrid;
Panel3: TPanel;
DBGrid2: TDBGrid;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
JS110Form: TJS110Form;
implementation
uses main, JS230Unit, JS220Unit, JS210Unit;
{$R *.dfm}
procedure TJS110Form.Button1Click(Sender: TObject);
begin
inherited;
try {--- 弹出仓库结算单窗体 ---}
MainForm.Caption := '货运作业物流系统 --- ' + MainForm.JS230.Caption;
{--- 显示窗体的标题变化 ---}
JS230Form := TJS230Form.Create(Application);
JS230Form.ManualDock(MainForm.Panel1, nil, AlClient)
except
MessageBox(0, '仓库结算单窗体创建错误', '产生严重例外错误', MB_OK +
MB_ICONSTOP);
end;
end;
procedure TJS110Form.Button2Click(Sender: TObject);
begin
inherited;
try {--- 弹出费用统计窗体 ---}
MainForm.Caption := '货运作业物流系统 --- ' + MainForm.JS220.Caption;
{--- 显示窗体的标题变化 ---}
JS220Form := TJS220Form.Create(Application);
JS220Form.ManualDock(MainForm.Panel1, nil, AlClient)
except
MessageBox(0, '费用统计窗体创建错误', '产生严重例外错误', MB_OK +
MB_ICONSTOP);
end;
end;
procedure TJS110Form.Button3Click(Sender: TObject);
begin
inherited;
try {--- 弹出结算分单窗体 ---}
MainForm.Caption := '货运作业物流系统 --- ' + MainForm.JS210.Caption;
{--- 显示窗体的标题变化 ---}
JS210Form := TJS210Form.Create(Application);
JS210Form.ManualDock(MainForm.Panel1, nil, AlClient)
except
MessageBox(0, '结算分单窗体创建错误', '产生严重例外错误', MB_OK +
MB_ICONSTOP);
end;
end;
end.
不管是弹出仓库结算单窗体、费用结算窗体还是结算分单窗体都会出错,错误提示信息是
工程1.exe检测到错误类EAccessViolation,错误信息:'Access violation at address 00403DD8 in module '1.exe'.Read of address 0000001C'.进程终止.使用单步或运行继续运行.
代码哪错了?改怎么改的?改得能用的,追加分 展开
unit JS110Unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, PublicUnit, jpeg, ExtCtrls, StdCtrls, Grids, DBGrids;
type
TJS110Form = class(TPublicUnit)
Panel1: TPanel;
Panel2: TPanel;
DBGrid1: TDBGrid;
Panel3: TPanel;
DBGrid2: TDBGrid;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
JS110Form: TJS110Form;
implementation
uses main, JS230Unit, JS220Unit, JS210Unit;
{$R *.dfm}
procedure TJS110Form.Button1Click(Sender: TObject);
begin
inherited;
try {--- 弹出仓库结算单窗体 ---}
MainForm.Caption := '货运作业物流系统 --- ' + MainForm.JS230.Caption;
{--- 显示窗体的标题变化 ---}
JS230Form := TJS230Form.Create(Application);
JS230Form.ManualDock(MainForm.Panel1, nil, AlClient)
except
MessageBox(0, '仓库结算单窗体创建错误', '产生严重例外错误', MB_OK +
MB_ICONSTOP);
end;
end;
procedure TJS110Form.Button2Click(Sender: TObject);
begin
inherited;
try {--- 弹出费用统计窗体 ---}
MainForm.Caption := '货运作业物流系统 --- ' + MainForm.JS220.Caption;
{--- 显示窗体的标题变化 ---}
JS220Form := TJS220Form.Create(Application);
JS220Form.ManualDock(MainForm.Panel1, nil, AlClient)
except
MessageBox(0, '费用统计窗体创建错误', '产生严重例外错误', MB_OK +
MB_ICONSTOP);
end;
end;
procedure TJS110Form.Button3Click(Sender: TObject);
begin
inherited;
try {--- 弹出结算分单窗体 ---}
MainForm.Caption := '货运作业物流系统 --- ' + MainForm.JS210.Caption;
{--- 显示窗体的标题变化 ---}
JS210Form := TJS210Form.Create(Application);
JS210Form.ManualDock(MainForm.Panel1, nil, AlClient)
except
MessageBox(0, '结算分单窗体创建错误', '产生严重例外错误', MB_OK +
MB_ICONSTOP);
end;
end;
end.
不管是弹出仓库结算单窗体、费用结算窗体还是结算分单窗体都会出错,错误提示信息是
工程1.exe检测到错误类EAccessViolation,错误信息:'Access violation at address 00403DD8 in module '1.exe'.Read of address 0000001C'.进程终止.使用单步或运行继续运行.
代码哪错了?改怎么改的?改得能用的,追加分 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询