SRL Archive - Help and Support

Form Freezing Problem


shaunthasheep

2007-01-14 16:47:32

[more of a general scar question]

i am making a program that connects to internet *through the connection functions* and it gets data from the host every time, by using a TTimer, but every time it freezes(the form)… which sucks (form is pretty much needed). TTimer, using .OnTimer. calls a procedure like every 1-2 seconds (needs to update fast) the procedure calls the ReadConnectData function (which just grabs the data, (function doesn't take less then 1 second, fast as other functions)) and then uses other functions to process and parse the data. but the form freezes like hell (even if it checks like every 2 seconds.) any idea on how i can fix this?

i mean u can still use form, but it frozen more then unfrozen.

GoF

2007-02-10 14:14:24

Hmm… I wish i could help :( Cant think of anything right now.

Off topic… But i think those are bulldozers more likely than tractors.. :p

Yakman

2007-02-10 15:51:02

how about making the update procedure called in another thread?


procedure UpdateFromInternet;
begin
//update from internet;
end;

procedure SafeUpdateFromInternet;
var t:TVariantArray;
begin
t:= [];
ThreadSafeCall('UpdateFromInternet',t);
end;

procedure OnUpdateTimer(Sender:TObject);
begin
SafeUpdateFromInternet;
end;

Infantry001

2007-02-18 21:37:01

I see it looks like you are trying to make an rs client… in SCAR?