Possible Duplicate:
Passing parameters to _beginthreadex
How can I call TestFunction2 instead of TestFunction1 in ExecuteLocalThread using beginthreadex as TestFunction2 contains 3 additional parameters
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 );
}
Create a struct which contains all the data you want to pass then pass a pointer to that into your thread entrypoint