문제

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?

도움이 되었습니까?

해결책

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top