K
kuer6983
Unregistered / Unconfirmed
GUEST, unregistred user!
主程序有定时器,每10秒触发一次procedure TFormMain.RxTimer1Timer(Sender: TObject);begin //if Assigned(Form1) then //即使Form1打开状态,Form1也一直等于nil if Assigned(Application.FindComponent('Form1')) then Form1.MemoStu.Lines.Add(FormatDateTime('hh:mm:ss ', now));end;主窗体中有一个按钮,点击显示Form1procedure TForm2000.Button1Click(Sender: TObject);begin with TForm1.Create(Application) do begin formStyle := fsStayOnTop
Show
//模式窗体不行,后改成非模式的,还是出错 //try //ShowModal
//finally // Free
//end
end;end;Form1关闭做了处理procedure TForm1.FormClose(Sender: TObject
var Action: TCloseAction);begin Action := caFree;end;procedure TForm1.FormDestroy(Sender: TObject);begin Form1.Free
Form1 := nil;end;这样之后,运行程序,如果Form1没打开的时候运行正常,但是如果在Form1打开的情况运行到if Assigned(Application.FindComponent('Form1')) then这句就出错,提示access vio..内存访问错误到底是什么问题呐, 运行环境d5 + windows xp
Show
//模式窗体不行,后改成非模式的,还是出错 //try //ShowModal
//finally // Free
//end
end;end;Form1关闭做了处理procedure TForm1.FormClose(Sender: TObject
var Action: TCloseAction);begin Action := caFree;end;procedure TForm1.FormDestroy(Sender: TObject);begin Form1.Free
Form1 := nil;end;这样之后,运行程序,如果Form1没打开的时候运行正常,但是如果在Form1打开的情况运行到if Assigned(Application.FindComponent('Form1')) then这句就出错,提示access vio..内存访问错误到底是什么问题呐, 运行环境d5 + windows xp