_beginthreadex cannot convert from 'overloaded-function'

后端 未结 2 1094
我寻月下人不归
我寻月下人不归 2021-01-26 07:00

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

2条回答
  •  旧巷少年郎
    2021-01-26 07:50

    _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.

提交回复
热议问题