【发布时间】:2012-09-26 08:04:08
【问题描述】:
如何将int参数传递给CreateThread回调函数?我试试看:
DWORD WINAPI mHandler(LPVOID sId) {
...
arr[(int)sId]
...
}
int id=1;
CreateThread(NULL, NULL, mHandler, (LPVOID)id, NULL, NULL);
但我收到警告:
warning C4311: 'type cast' : pointer truncation from 'LPVOID' to 'int'
warning C4312: 'type cast' : conversion from 'int' to 'LPVOID' of greater size
【问题讨论】:
标签: c++ int createthread