المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Problem with Win32 Threads



C++ Programming
11-24-2009, 11:21 AM
Hello all,

I´m trying to multithread an application by using CreateThread function. So far I´ve done the following:


//Here I initialize the Thread
LPDWORD iID;
HANDLE hThread; // array of thread handles
hThread = CreateThread (
0, // Security attributes
0, // Stack size
(LPTHREAD_START_ROUTINE)OpenCVWin32::Form1::Threadi,
NULL,
CREATE_SUSPENDED,
iID);
}



//Called function
static DWORD WINAPI Threadi()
{
System::Windows::Forms::MessageBox::Show("Hi there!");
return 0;
}


When I launch the application, the thread is not created, as I cannot go inside the Threadi function. I´m right now using VC++ 2008. Does anyone has a suggestion on why this could be happening?

Thanks