ThreadPool.RegisterWaitForSingleObject - what to pass as Object?

Merrion

Junior Contributor
Joined
Sep 29, 2001
Messages
265
Location
Dublin, Ireland
The function ThreadPool.RegisterWaitForSingleObject takes parameters WaitHandle, WaitOrTimerCallback, Object, Integer, Boolean

WaitHandle is the handle to be waited on,
WaitOrTimerCallback is a delegate sub,
Integer is the timeout in millisecond (or -1 for infinite)
Boolean is whether this is only fired once

But what goes in Object ?

Thanks in advance,
Baffled of Ballsbridge
 
*Resolved* ThreadPool.RegisterWaitForSingleObject - what to pass as Object?

Never mind - it's there so you can pass anything you need to the callback procedure

*sigh - so much to learn!*
 
Thank God it's there. Back in VB6 you only got a 32-bit parameter to work with, and had to use it as a pointer if you wanted to pass more than a long integer. Then in the callback you had to allocate memory and set it to the passed pointer. Sure, it wasn't exactly hard to do, but this saves us the trouble.
 
Back
Top