【发布时间】:2013-08-29 10:38:28
【问题描述】:
我在我的 dll 中使用 OmniThreadLibrary 2.09,主应用程序和 dll 使用相同的 SimpleShareMem 内存管理器。
我用这段代码创建了自己的监视器:
FMonitor: TOmniEventMonitor;
...
FMonitor := TOmniEventMonitor.Create(nil);
当我尝试使用此监视器创建新任务时,我收到错误消息“只能使用单个监视器监视任务”
FTask := OtlTaskControl.CreateTask(TaskWorker)
.OnMessage(
procedure(const ATaskControl: IOmniTaskControl; const AMsg: TOmniMessage)
begin
...
end)
.MonitorWith(FMonitor) // <----- Error
.OnTerminated(
procedure (const ATaskControl: IOmniTaskControl)
begin
...
end)
.Run();
如何使用自己的显示器监控我的任务?
【问题讨论】:
标签: delphi dll delphi-xe4 omnithreadlibrary