c++ 创建线程以及参数传递
//创建线程,传递参数 DWORD dwThreadID = 0; HANDLE hThread = CreateThread(NULL, 0, MonitorThreadFunction, this , 0, &dwThreadID);
//线程过程定义及参数接收 DWORD WINAPI MonitorThreadFunction(LPVOID lpParam) { CValidator* securityValidator = static_cast<CValidator*>(lpParam); while(true) { Sleep(5000); securityValidator->fireValidateEvent(5); } /*MessageBox(NULL,L"thread",L"start",0);*/ return 0; }
桂棹兮兰桨,击空明兮溯流光。