Hey guys, so I am writing an application that uses Multi threading API.
I keep getting access violation and I have no idea why even when I put a function in the thread that updates the list it gives me access violation after about 4-5 minutes.
What am I doing wrong?
Heres the code:
Top code:
Type
Void = Type Pointer;
var
Form1: TForm1;
t4id, t4h : Cardinal;
in start button:
t4h := CreateThread(nil, 1024, @t4,nil,0,t4id);
In body;
Procedure t4;SafeCall;
var
copyint:integer;
begin
sleep(505);
while True do
begin
sleep(1000);
form1.lstEmails.AddItem('hey4',form1.ssender);
// FetchHTML(getphone,3);
end;
end;
I keep getting access violation and I have no idea why even when I put a function in the thread that updates the list it gives me access violation after about 4-5 minutes.
What am I doing wrong?
Heres the code:
Top code:
Type
Void = Type Pointer;
var
Form1: TForm1;
t4id, t4h : Cardinal;
in start button:
t4h := CreateThread(nil, 1024, @t4,nil,0,t4id);
In body;
Procedure t4;SafeCall;
var
copyint:integer;
begin
sleep(505);
while True do
begin
sleep(1000);
form1.lstEmails.AddItem('hey4',form1.ssender);
// FetchHTML(getphone,3);
end;
end;