Question

With Delphi XE2, how can I play/update a TAnimate animation while a TIdHTTP object is working in the background? For example, I have IdHTTP1.Post waiting for this PHP "app" on a remote server to complete:

<?php
echo date('h:i:s') . "\n";
sleep(5);
echo date('h:i:s') . "\n";
?>

In these 5 seconds even a threaded timer (TJvThreadTimer) does not fire! I have also tried to put IdHTTP1.Post inside a separate thread using the OmniThreadLibrary with CreateTask. Even in this case the threaded timer does not fire, nor is the TAnimate animation updated.
So is there anything I can do to animate the animation while IdHTTP1.Post is working in the background?

Was it helpful?

Solution

It seems that the problem can EASILY be solved just by putting a TIdAntiFreeze component on the form (and setting its IdleTimeOut property to 10 instead of default 250). No threads needed, the animation just plays fine while IdHTTP.Post is working 5 seconds in the background! Very nice!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top