Einzelnen Beitrag anzeigen

Medium

Registriert seit: 23. Jan 2008
3.685 Beiträge
 
Delphi 2007 Enterprise
 
#4

AW: Show thread progress in modal window

  Alt 21. Jan 2013, 12:30
The problem is, that by having all the thread's code execute synchronized, you effectively have it running in the main-thread of your normal windows. (That is the purpose of synchronizing.) Depending on whether you have that level of control over the long process (i.e. it is your code), scrapping the thread and instead work with a sort of OnProgress() Event should be better suited for this.

Another thing: If you have the process (calculations or whatever) running in the main thread, but do display tasks in a separate thread, you basically are doing things backwards. Put the long running process into a thread, and have it send messages about it's status to a normal form to do status displays on. That would be the proper way.
"When one person suffers from a delusion, it is called insanity. When a million people suffer from a delusion, it is called religion." (Richard Dawkins)
  Mit Zitat antworten Zitat