Reputation: 2516
I want to use OmniThreadLibrary in a project I am working on Delphi XE2, I've followed the instructions.
The instructions are pretty simple and the OmniEventMonitor is in the palette.
However, I can not run a single one of the examples.
For example, when i try to run:
procedure TForm2.Button1Click(Sender: TObject);
begin
Button1.Enabled := false;
Parallel.Async(
procedure
begin
// executed in background thread
Sleep(500);
MessageBeep($FFFFFFFF);
end,
Parallel.TaskConfig.OnTerminated(
procedure (const task: IOmniTaskControl)
begin
// executed in main thread
btnAsync.Enabled := true;
end
)
);
end;
I get the error Undeclared Identifier Parallel.
Did I do something wrong during the installation?
Upvotes: 2
Views: 596
Reputation: 613461
The error message is:
Undeclared Identifier Parallel.
Parallel
is a class (containing class methods) declared in the OtlParallel
unit. Which means that if the compiler cannot see the Parallel
class, then you have not added OtlParallel
to your uses clause.
Upvotes: 5