大家好,这是我的代码
#include "StdAfx.h"
#include <iostream>
#include <windows.h>
#include <process.h>
unsigned int __stdcall threadproc(void* lparam)
{
std::cout << "my thread" << std::endl;
return 0;
}
int main()
{
unsigned uiThread1ID = 0;
uintptr_t th = _beginthreadex(NULL, 0, threadproc, NULL, 0, &uiThread1ID);
WaitForSingleObject(th, INFINITE/*optional timeout, in ms*/);
return 0;
}
但我收到以下错误消息
错误 C2664:“WaitForSingleObject”:无法将参数 1 从“uintptr_t”转换为“HANDLE”
有人可以帮我吗?