So, my world of thread pooling is much simpler than yours, Rick.
One problem I did have was with:
Code: Select all
Work = CreateThreadpoolWork(cast(PTP_WORK_CALLBACK,@myThread),cast(PVOID,Whatever), Null)
Work is carved in stone or, I should say, the TP_WORK structure is carved in stone. If 'Whatever' changes then we cannot use he same TP_WORK. So, instead of passing 'Whatever' I am passing the address of 'Whatever'. If 'Whatever' changes its address will not so we can use the same TP_WORK. Of course, BYREF would do the job for us but we cannot use that so I am using a '@'/'*' combination. Bit of a dog's dinner but even a dog's dinner is OK when we are hungry.<smile>