Answer the question
In order to leave comments, you need to log in
Delphi creating an instance of a class in a thread?
It's hard to formulate the question correctly, but I'll try.
I have a good idea of how everything works.
I work with flows, I manage.
Synchronization.
Problems.
And other errors in multi-threaded design.
This question may seem stupid, a potential mistake can ruin your life, and then suicide.
I will give a code example
threadCard := TCardThread.CreateAnonymousThread(
procedure
var
this: TCardThread;
begin
this := TThread.CurrentThread as TCardThread;
FDQueryUrl := Dm.GetQuery();
...
end;
function TDm.GetQuery: TFDQuery;
begin
Result := TFDQuery.Create(nil);
Result.Connection := TFDConnection.Create(nil);
Result.Connection.Params.Assign(FDConnection.Params);
end;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question