The documentation for _endthreadex stipulates that you must call ::CloseHandle()yourself when your thread terminates, but it is not clear to me how the needed handle is obtained. _beginthreadex returns an unsigned long which the documentation describes as a "handle" to the thread, but Winnt.h typedefs a HANDLE as a void pointer -- not an unsigned long. Needless to say, I'm leery of blindly casting an unsigned long to a void*. Does anyone have any ideas about this?

Thanks

Doug Brower