Jump to content
magio74

Omnithread examples Target Delphi Version

Recommended Posts

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×