Board index » delphi » WaitEvent...

WaitEvent...

I have a very simple question, but yet, no answer from Borland
documentation.

Here is my problem:
I use an Active-X html viewer to get text from the internet. When the
layout is completed, I need to "copy" this text to a richedit, where I
can manipulate it. Then I go to another page, "copy" again, manipulate
again, and so forth...

So in one procedure, I ask the html component to retrieve an html
document. But it work in a different thread, so the subsequent lines in
my procedure are executed immediately, instead of waiting for the html
component to complete its layout.

There is an event called OnLayoutComplete in the html component.

So I would need to (from my procedure):

1. Ask the html component to start loading a page (which takes time);
2. Wait for the OnLayoutComplete event to happen; <---
3. Continue my manipulations...

So my question is: "How do I wait for an event from a specific component
(object) in a procedure?"

I know this is basic, but I just don't know how to do it in
Objective-Pascal...

Thanks,

Louis Pelletier.

 

Re:WaitEvent...


You can sit in a while loop of application.processmessages until your event
goes off...but I would also suggest having another way to exit this loop...

Rick Peterson

Quote
Jean-Luc Boutin wrote in message <3559C2BC.7A22...@agora.ulaval.ca>...
>I have a very simple question, but yet, no answer from Borland
>documentation.

>Here is my problem:
>I use an Active-X html viewer to get text from the internet. When the
>layout is completed, I need to "copy" this text to a richedit, where I
>can manipulate it. Then I go to another page, "copy" again, manipulate
>again, and so forth...

>So in one procedure, I ask the html component to retrieve an html
>document. But it work in a different thread, so the subsequent lines in
>my procedure are executed immediately, instead of waiting for the html
>component to complete its layout.

>There is an event called OnLayoutComplete in the html component.

>So I would need to (from my procedure):

>1. Ask the html component to start loading a page (which takes time);
>2. Wait for the OnLayoutComplete event to happen; <---
>3. Continue my manipulations...

>So my question is: "How do I wait for an event from a specific component
>(object) in a procedure?"

>I know this is basic, but I just don't know how to do it in
>Objective-Pascal...

>Thanks,

>Louis Pelletier.

Other Threads