So I was making a function to print text layered across a different window, and I wanted it to be in a separate thread so I can run a timer for the text to display while leaving
In a nutshell thread startup functions need to follow an exact prototype, and not the one you used.
They can accept a function that takes a single void *.
There are several solutions.
_beginthreadex(0, 0, DrawText,(void *)(hwnd, 175, 15, text, 8), 0 , &threadID);
According to MSDN, third argument must be pointer to a function whose argument is of type void*
. In your case, DrawText
is a function whose argument is not void*
but (HWND hWnd, float x, float y, wchar_t* mybuffer, float DisplayTime)
. Hence the error and take a look at the examples in the link.