D
dolphinji
Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是Delphi6+ADO+SQL7
每次关闭主窗体时就报此错,在运行一步就报“RunTime Error 217”!我想是和线程处理有关,能帮我看看吗?
procedure TForm_main.FormCreate(Sender: TObject);
begin
InitializeCriticalSection(Critical1);//临界区
TThread:=TestThread.create;
//启动线程
end;
procedure TForm_main.N_quitClick(Sender: TObject);
begin
if Assigned(Form_Show) then
begin
Form_Show.Close;
TDrawLines.Terminate;
TThread.Terminate;
end;
Application.Terminate;
end;
procedure TForm_main.FormDestroy(Sender: TObject);
begin
DeleteCriticalSection(Critical1);//临界区
end;
procedure TForm_Show.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
Form_Show:=nil;
end;
每次关闭主窗体时就报此错,在运行一步就报“RunTime Error 217”!我想是和线程处理有关,能帮我看看吗?
procedure TForm_main.FormCreate(Sender: TObject);
begin
InitializeCriticalSection(Critical1);//临界区
TThread:=TestThread.create;
//启动线程
end;
procedure TForm_main.N_quitClick(Sender: TObject);
begin
if Assigned(Form_Show) then
begin
Form_Show.Close;
TDrawLines.Terminate;
TThread.Terminate;
end;
Application.Terminate;
end;
procedure TForm_main.FormDestroy(Sender: TObject);
begin
DeleteCriticalSection(Critical1);//临界区
end;
procedure TForm_Show.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
Form_Show:=nil;
end;