Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to pass PWOHandleArray to WaitForMultipleObjects

258 views
Skip to first unread message

Alexey Karpenko

unread,
May 22, 2001, 11:54:18 AM5/22/01
to
Hi all,

Could anybody please tell me what's wrong with this code? When using
WaitForSingleObject instead of WaitForMultipleObjects and pass only one
handle it's ok. But when I try to pass an array nothing happens as needed.

procedure TTrackingThread.Execute;
var
Handles: array[0..5] of THandle;
begin
Handles[0] := FAkDirWatch.FhFileName;
Handles[1] := FAkDirWatch.FhDirName;
Handles[2] := FAkDirWatch.FhAttributes;
Handles[3] := FAkDirWatch.FhSize;
Handles[4] := FAkDirWatch.FhLastWrite;
Handles[5] := FAkDirWatch.FhSecurity;

while not Terminated do begin
case WaitForMultipleObjects(6, @Handles, False, INFINITE) of
...


Could anybody guide me? I'm sure it must work, but it doesn't!

Many thanks in advance,
Alexey Karpenko

Peter Below (TeamB)

unread,
May 22, 2001, 3:38:43 PM5/22/01
to
In article <3b0a8bd9_1@dnews>, Alexey Karpenko wrote:
> Could anybody please tell me what's wrong with this code? When using
> WaitForSingleObject instead of WaitForMultipleObjects and pass only one
> handle it's ok. But when I try to pass an array nothing happens as needed.

Not a very informative problem description. What is happening? Does the Wait
not wait? If not, what does it return? If one of the handles in your array
is in a signalled state already the wait would of course return immediately.

Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.

Alexey Karpenko

unread,
May 23, 2001, 2:48:48 AM5/23/01
to
Peter, thank you for your interest. I've already managed this problem. It
returned WAIT_FAILED, because some of the handles in the array were zeros.
Now it's ok.

Thank you again,
Alexey Karpenko

"Peter Below (TeamB)" <10011...@compuXXserve.com> wrote in message
news:VA.000070f...@antispam.compuserve.com...

0 new messages