Hello everybody,
I'm a novice with the OTL. And I've written a simple app to experiment with it. But it causes the EOSError with the "System Error. Code: 1400. Invalid window handle." message in the TOmniContainerWindowsMessageObserverImpl.PostWithRetry method. Could anybody explain what is wrong with my code and (if it is not correct) provide a fix or solution?
I use Delphi 10.2.3 (Tokyo) and OTL 3.07.9.
Any help is appreciated.
This is my code:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses
OtlParallel;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
TThread.CreateAnonymousThread(
procedure
begin
Parallel.Async(
procedure
begin
Sleep(100);
end);
end).Start;
end;
end.