Does TRichView have support for multithreading?
I'm developing a DataSnap server application that generates RichViews on demand. If I call the remote method on 2 clients or more at the same time I get this error "Canvas does not allow drawing".
I'm not using the same TRichview for all method calls. Every method creates its own TRichView component. The only shared component is the TRVStyle.
Are there any workaround for it? I accept a sincronized-one-thread solution.
Thanks!
Multithreading support
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I'm using a DataSnap Server, so the remote method are running on its own thread. To simplify the things I decided to use a Critical Section.
The code is show below:
The Critical Section is working well, but sometimes, even when I'm running a single thread, I get the Canvas error...
Do you guys have any tip on how to solve this?
Thanks!
The code is show below:
Code: Select all
procedure TDataSnapServer.GenerateRichView;
begin
CS.Acquire;
try
With TfrmGenerateRichView.Create(nil) do begin
DoGenerate;
Free;
End;
finally
CS.Release;
end;
end;
Do you guys have any tip on how to solve this?
Thanks!