在使用利用CreateThread创建线程时
struct A
{
DWORD WINAPI MyThreadFunction() {}
void Run()
{
HANDLE hThread = CreateThread(
NULL, // default security attributes
0, // use default stack size
MyThreadFunction, // thread function name
0, // argument to thread function
0, // use default creation flags
NULL); // returns the thread identifier
}
};
visual studio 报了如下错误:E0167 argument of type "DWORD (__stdcall A::*)()" is incompatible with parameter of type "LPTHREAD_START_ROUTINE"
问题解决办法参考文档[ThreadProc callback function][1]
[1]: https://docs.microsoft.com/zh-cn/previous-versions/windows/desktop/legacy/ms686736(v=vs.85)