F
flyang2001
Unregistered / Unconfirmed
GUEST, unregistred user!
看了刘艺老师的Delphi面向对象变成思想后,我使用Dll封装对象。
在Application.Terminate调试过程中,弹出以下对话框——
---------------------------
Debugger Fault Notification
---------------------------
Project D:/WorkSpace/NRMIS/源码目录/client/NRMIS.exe raised too many consecutive exceptions: 'access violation at 0x00233166: read of address 0x00dd20cc'. Process Stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
我怀疑是在释放Dll中创建的对象的资源的时候出的问题,我在一个子窗体中用以下方法调用的,当只调用Create方法时不报错,再调用add方法后就出问题了。
var
dbNutrOff: INutrOffice;
m_objADODS: TADODataSet;
procedure TFormNutrOffSet.Add;
begin
dbNutrOff := NutrOfficeObj;
dbNutrOff.Name := EdtNutrOffName.Text;
dbNutrOff.Code := EdtNutrOffCode.Text;
dbNutrOff.Flag := RGpNutrOffFlag.ItemIndex;
dbNutrOff.Note := EdtNutrOffNote.Text;
dbNutrOff.Connect := g_objConn.ConnectionObject;
if dbNutrOff.AddRecord = -1 then g_funMsg('请检查输入条件。',msgErr);
m_objADODS.Recordset := dbNutrOff.GetRecord;
dbNutrOff := nil;
DataSource1.DataSet := m_objADODS;
end;
procedure TFormNutrOffSet.FormCreate(Sender: TObject);
begin
m_objADODS := TADODataSet.Create(nil);
dbNutrOff := NutrOfficeObj;
dbNutrOff.Connect := g_objConn.ConnectionObject;
m_objADODS.Recordset := dbNutrOff.GetRecord;
dbNutrOff := nil;
DataSource1.DataSet := m_objADODS;
end;
procedure TFormNutrOffSet.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
// m_objADODS := nil;
end;
不知该如何解决,请大家帮忙。
在Application.Terminate调试过程中,弹出以下对话框——
---------------------------
Debugger Fault Notification
---------------------------
Project D:/WorkSpace/NRMIS/源码目录/client/NRMIS.exe raised too many consecutive exceptions: 'access violation at 0x00233166: read of address 0x00dd20cc'. Process Stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
我怀疑是在释放Dll中创建的对象的资源的时候出的问题,我在一个子窗体中用以下方法调用的,当只调用Create方法时不报错,再调用add方法后就出问题了。
var
dbNutrOff: INutrOffice;
m_objADODS: TADODataSet;
procedure TFormNutrOffSet.Add;
begin
dbNutrOff := NutrOfficeObj;
dbNutrOff.Name := EdtNutrOffName.Text;
dbNutrOff.Code := EdtNutrOffCode.Text;
dbNutrOff.Flag := RGpNutrOffFlag.ItemIndex;
dbNutrOff.Note := EdtNutrOffNote.Text;
dbNutrOff.Connect := g_objConn.ConnectionObject;
if dbNutrOff.AddRecord = -1 then g_funMsg('请检查输入条件。',msgErr);
m_objADODS.Recordset := dbNutrOff.GetRecord;
dbNutrOff := nil;
DataSource1.DataSet := m_objADODS;
end;
procedure TFormNutrOffSet.FormCreate(Sender: TObject);
begin
m_objADODS := TADODataSet.Create(nil);
dbNutrOff := NutrOfficeObj;
dbNutrOff.Connect := g_objConn.ConnectionObject;
m_objADODS.Recordset := dbNutrOff.GetRecord;
dbNutrOff := nil;
DataSource1.DataSet := m_objADODS;
end;
procedure TFormNutrOffSet.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
// m_objADODS := nil;
end;
不知该如何解决,请大家帮忙。