请教vc++的大神,前辈们,创建线程传递参数问题??

2025-04-25 02:28:44
推荐回答(1个)
回答1:

报什么错,贴你错误的代码,
typedef struct tagID{ int id1, int id2 }IDS;
IDS ids;
ids.id1=1;
ids.id2=2;

HANDLE hThread = (HANDLE)_beginthreadex(....., &proc, &ids, ...);
::WaitForSingleObject(hThread, INFINIT);