magio74 0 Posted April 10, 2021 Hi All, I am new on the forum and a search on it didn't show me an answer. I am using Delphi XE (it is the one that the company I work for has license so I am tied to it). I downloaded OmniThread library with Delphinus. I was able to install Delphinus by editing some uses on the code. Now I am trying to build the progress bar sample code from the OmniThread examples subfolder with no success. I've read that OmniThread LIbrary requires at least Delphi 2007 but maybe the samples do not. Right? For example, original upper code is like this unit ppb1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.ExtCtrls, System.Threading, I simply edit it to match my compiler version in this way, unit ppb1; interface uses {$IFNDEF VER220} Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.ExtCtrls, System.Threading, {$ELSE} Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls, ExtCtrls, {$ENDIF} Of course that could be much extended using all other compilers versions but I did just the faster approach in order to build the sample code and try to understand it That works fine... but the thing gets worse when Delphi XE Compiler (ver 220) does not know what an ITask is, I assume is an Interface but really don't know. I tried to find library or code that implements Itask with no success, the only reference I found was on Embarcadero Site regarding Delphi XE7 which is quite new. So the question is: Is there any dependency I am missing? If ITask is quite new I assume this example won't work with Delphi XE2, XE3, etc. Is there a workaround for this? Thanks in advance Trying to Share this post Link to post
Nigel Thomas 36 Posted April 11, 2021 The iTask definition is required for the Parallel Programming Library routines, these are available in XE7+. The article linked to in the ProgressBar example source is a good read: http://www.thedelphigeek.com/2015/10/updating-progress-bar-from-parallel-for.html Share this post Link to post
KodeZwerg 54 Posted April 11, 2021 12 hours ago, magio74 said: Of course that could be much extended using all other compilers versions but I did just the faster approach in order to build the sample code and try to understand it {$IF CompilerVersion >= 23} {$DEFINE NameSpace} {$ELSE CompilerVersion} {$UNDEF NameSpace} {$IFEND CompilerVersion} unit ppb1; interface uses {$IFDEF NameSpace} Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.ExtCtrls, System.Threading, {$ELSE NameSpace} Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls, ExtCtrls, {$ENDIF NameSpace} Thats a more generic approach for namespace handling. Share this post Link to post