偶又发现了点:因为偶DLL的窗体是MDICHILD,所以主程序在传递参数的时候把SCREEN也传递过去了,在DLL里面有这样的代码:
var
DllApp: TApplication;
// DllScr: TScreen;
{$R *.res}
procedure MyDllHandle(iReaSon: Integer);
begin
if iReaSon = 0 then
begin
Application := DllApp;
// Screen := DllScr;
end;
if iReaSon = 1 then
begin
DllApp := Application;
// DllScr := Screen;
end;
end;
exports ShowForm;
begin
DllProc := @MyDllHandle;
end.
在出口函数里:
procedure ShowForm(Scr: TScreen;App: TApplication;ADOC: TADOConnection);
begin
// Screen := Scr;
Application := App;
with TForm1.Create(nil) do
begin
try
Showmodal;
finally
Free;
end;
end;
end;
错误提示:
“Project c:\……\Project1.exe raised too many consecutive exceptions
'access violation at 0x06f836a2 : read of address 0x07044638' process stopped.
uses step or run to continue.
别的DLL里没有 ,现在就这一个DLL了!!