Re: Threads - why so hard
Use Global function instead of member func.
Ex:
void CDownloadView::OnInitialUpdate()
{
CListView::OnInitialUpdate();
hDownload= CreateThread( NULL, 0L, CheckDownloadFiles,
( LPVOID )&st1, 0, &thId );
}
DWORD WINAPI CheckDownloadFiles( LPVOID lParam )
{
//code...
}
Re: Threads - why so hard
You can and should use AfxBeginThread. It's easier and more flexible to work with than _beginthread...
The first problem I see is that your thread function (thread_OnUpdate) is not in the right signature:
UINT CLeftView::thread_OnUpdate(LPVOID pParam)
The second thing which MAY be wrong is that your thread function is not static. In other words, the thread function cannot be a regular member function. It must be static or global.
That should take care of it. Good luck!
Alvaro