How to wait for Terminated

edited 8:51PM in FastReport 4.0
In a form with a TfrxPreview as child, I need to add a Close button. This button must cancel the Fast Report work, wait for the background task and return.


First tentative, in the OnClik event I do:

myReport->Terminated();
Close();

It fails because the background task is still working. I cannot delete the form because some events like OnProgressStop can be called.

How can I wait the end of background task?

It would be something like:


myReport->Terminated();
while(engine.IsRunning())
{
Application->ProcessMessages();
}

Close();




Thank you

Comments

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.