Page 1 of 1

TAniIndicator

PostPosted: Fri Dec 16, 2016 6:59 am
by Lena
Code: Select all
//***
std::unique_ptr<TMemoryStream> WelcomeINI(new TMemoryStream());

 for (int i = 1; i <= 25; i++)
  {
      String NameOfImage = IntToStr(i) + ".png";
      String URLLink = L"http://welcome.um.la/myimg/" + NameOfImage;
      try
      {
      IdHTTP1->Get(URLLink, WelcomeINI.get());
      WelcomeINI->Position = 0;
      }
      catch(...)
         {
          WelcomeINI->LoadFromFile("72x72.png"); //image by default
          WelcomeINI->Position = 0;
         }
//*** other code

void __fastcall TForm1::IdHTTP1WorkBegin(TObject *ASender, TWorkMode AWorkMode, __int64 AWorkCountMax)

{
 AniIndicator1->Enabled = true;
}



Is it possible without TThread to see the rotation AniIndicator1? Now it is frozen

Re: TAniIndicator

PostPosted: Wed Dec 21, 2016 4:23 pm
by rlebeau
Lena wrote:Is it possible without TThread to see the rotation AniIndicator1? Now it is frozen


If this code is running in the main UI thread, then it makes sense why TAniIndicator would be frozen, as no new messages are being processed while the loop is running. So yes, you should move the loop to a worker thread that synchronizes access to the UI when needed.