TAniIndicator

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

TAniIndicator

Postby Lena » Fri Dec 16, 2016 6:59 am

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
Lena
BCBJ Master
BCBJ Master
 
Posts: 417
Joined: Sun Feb 06, 2011 1:28 pm

Re: TAniIndicator

Postby rlebeau » Wed Dec 21, 2016 4:23 pm

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.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1375
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA


Return to Technical

Who is online

Users browsing this forum: Bing [Bot] and 4 guests

cron