可能重复:
将参数传递给 _beginthreadex
我如何调用而TestFunction2
不是使用as包含 3 个附加参数TestFunction1
ExecuteLocalThread
beginthreadex
TestFunction2
unsigned __stdcall TestFunction1(void* timerPointer)
{
unsigned result =0;
printf("thread is running\n");
return result;
}
unsigned __stdcall TestFunction2(void* timerPointer, wchar_t *appId, wchar_t *userName, wchar_t *password)
{
unsigned result =0;
printf("thread is running\n");
return result;
}
void ExecuteLocalThread()
{
HANDLE heartBeatThread;
unsigned int hbThreadID;
heartBeatThread = (HANDLE)_beginthreadex(NULL, 0 , &TestFunction1, (void*)this, CREATE_SUSPENDED, &hbThreadID);
ResumeThread( heartBeatThread );
}