早晨试了,
1,把程序分解开,各自执行相应的exe文件,程序关闭时不发生任何错误,
2,主程序调用相应dll时,不打开dll关闭主程序也提示非法错误,
程序示例:
主程序
rocedure showdfxxt(H: THandle;AConn: TADOConnection;czym,czyxm,czyqx :string); cdecl;
external '../dfxxt5.0_6/dlldfxxt.dll';{ 指定过程来源 }
procedure TFrmmmain.N03Click(Sender: TObject);
begin
showdfxxt(Application.Handle,Datampub.Adocondf1,Gczym,Gczyxm,Gczyqx);
end;
dll程序
dpr: library dlldfxxt;
uses
SysUtils,
Classes,
Main in 'Main.pas' {MainForm},
Lfloor in 'Lfloor.pas' {FrmLfloor},
pview in 'pview.pas' {Frmpview},
setpara in 'setpara.pas' {Frmsetpara},
Unit1 in 'Unit1.pas' {Form1},
datamo in '../public/datamo.pas' {DataMpub: TDataModule},
gncolor in 'gncolor.pas' {Frmgncolor},
zbjclb in 'zbjclb.pas' {Frmzbjclb};
{$R *.res}
exports
showdfxxt;
begin
end;
mainform:
procedure showdfxxt(H:THandle;AConn: TADOConnection;czym,czyxm,czyqx :string);cdecl;
procedure showdfxxt(H:THandle;AConn:TADOConnection; czym,czyxm,czyqx :string);
begin
application.Handle:=H;
Application.CreateForm(TDatampub,Datampub);
with TMainForm.Create(Application) do
try
Datampub.Adocondf1 := AConn;
Datampub.Mczym :=czym;
Datampub.Mczyxm :=czyxm;
Datampub.mczyqx:=czyqx;
ShowModal; { 模式化显示窗体 }
finally
Free; {调用结束时销毁窗口}
end;
Datampub.Free;
end;
备注:程序运行没有任何错误,但就是退出时,出现非法错误(98下)
在2000下偶尔发生
"0x007b393e"指令引用的“0x0160a954"内存,该内存不能为“read" 怎么办???
要终止程序,请单击“确定"
错误
望各位多发表看法,我错在那里????