I'm creating a new thread but I'd like to supply a templated function to beginthreadex.
My thread function prototype is:
template<typename T>
unsigned int _stdcall GetArrayThread(void* pvStruct)
However, when a supply: "GetArrayThread<IClass1>" as the 3rd parameter to _beginthreadex, the compiler gives the following error:
error C2664: '_beginthreadex' : cannot convert parameter 3 from 'unsigned int (void *)' to 'unsigned int (__stdcall *)(void *)'
Passing "&GetArrayThread<IClass1>" makes no difference.
All was fine when 'GetArrayThread' was not templated, and I simply passed "GetArrayThread" as the 3rd parameter to _beginthreadex
Does anyone know if templated functions can be supplied to _beginthreadex