Jump to content
Sign in to follow this  
shineworld

TTask on Sydeny 10.4.1

Recommended Posts

Hi all,

 

I'm trying to use TTask to perform some parallel code with Sydney 10.4.1 looking at the sample code in Help System,

so it should be supported by 10.4.1:
 

image.thumb.png.6d895bfc42e15cb0812d5b51612b7c47.png


but I've got always the error:
[dcc32 Error] osIPCTCPServerContext.pas(423): E2250 There is no overloaded version of 'Create' that can be called with these arguments

image.thumb.png.392f661c39173805d9cf059cca882cb5.png


Have you any idea about it?

Thank you in advance for replies.

 

Share this post


Link to post

Try

var
  LTask : ITask;

begin
LTask := TTask.Run(
    procedure
    begin
        ...
    end );

end;

If you don't need LTask to control the running task later, which I assume in your case,

you better completely leave that out

begin
  TTask.Run(
    procedure
    begin
        ...
    end );

end;

 

  • Like 1

Share this post


Link to post

Works in Embarcadero® Delphi 10.4 Version 27.0.38860.1461

RAD Studio 10.4 Update 1

Not sure if this is 10.4.1

 

Share this post


Link to post

I personally just see a few entries in the structure pane while adding code to the VAR sections for example. But those immediately disappear on entering the code correctly is finished. For a short moment the one you mentioned appears too accompanied by many regarding TThread.Synchronize for example.

Edited by MichaelT

Share this post


Link to post

Works perfectly !!!
The only issue is on Delphi LSP which seems unable to elaborate pascal code for anonymous procedures on TTask( proc or TThread.Synchronize( Self, proc..,

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
Sign in to follow this  

×