Hello to all !

My question is simple : Can I use the API function WaitForSingleObject to wait for a thread when that thread was created with AfxBeginThread ???

Here is a sample of my code i'm using to create the thread :


pNewThread = AfxBeginThread(Thread_CheckFile, (LPVOID)&pParam);

pNewThread->m_bAutoDelete = FALSE;

dwRetVal = WaitForSingleObject(pNewThread->m_hThread, UNE_MINUTE);




Any help will be greatly appreciated !