Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.11.13;
Скачать: CL | DM;

Вниз

Вопрос по Thread, мож кто прояснит в чём дело...   Найти похожие ветки 

 
_Agent_   (2003-10-30 13:32) [0]

форма, на ней кнопка. Код проги:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TMyThread = class(TThread)
private
FA : Integer;
protected
procedure Execute; override;
public
constructor Create(a:integer);
end;
var
Form1: TForm1;
My: TMyThread;
implementation
{$R *.dfm}
constructor TMyThread.Create(a:integer);
begin
inherited Create(True);
FreeOnTerminate := True;
FA:=a;
resume;
end;
procedure TMyThread.Execute;
begin
ReturnValue:=FA;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
If not Assigned(My) then My.Create(3)else My.Terminate;
end;
end.
при нажатии кнопки выдаёт ошибку доступа к памяти. Почему?
заранее благодарен :)))


 
icWasya ©   (2003-10-30 13:45) [1]

ну во первых не
My.Create(3)
а
My:=TMyThread.Create(3)


 
_Agent_   (2003-10-30 13:50) [2]

Величайшее спасибо ..
мой косяк
недогледел :))))



Страницы: 1 вся ветка

Текущий архив: 2003.11.13;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.065 c
8-41731
SiDChik
2003-07-18 06:58
2003.11.13
Про OpenGL, а именно GLScene


4-42331
Sesh
2003-08-31 23:20
2003.11.13
Управлени Explorer


3-40832
chtr
2003-10-22 07:16
2003.11.13
Как ускорить запрос в Access


1-41181
Volly
2003-11-02 16:03
2003.11.13
Реализация переменного кол-ва параметров


14-41940
fool
2003-10-20 17:08
2003.11.13
MSSQL 7.0: непонятные тормоза