Click to See Complete Forum and Search --> : AfxBeginThread


jlopez
November 23rd, 2004, 06:31 AM
Once upon a time there was a thread:

UINT CIrisAdqDlg::CaptureImageThread(LPVOID pParam)
{
...
}

And one day I tried to launch it:

void CIrisAdqDlg::OnStart()
{
...
AfxBeginThread(CIrisAdqDlg::CaptureImageThread, this);
...
}

But VC++ didn't want:

...
error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (void *)'
...

I am sure it worked in the past, so I don't know what it's really happening now.
Thanks!

krmed
November 23rd, 2004, 06:46 AM
Since your thread function is a class member, it must be declared as static.

Hope that helps.

Andreas Masur
November 23rd, 2004, 07:35 AM
[ Moved thread ]

Andreas Masur
November 23rd, 2004, 07:37 AM
Once upon a time, there was a FAQs forum...and the answer can be found there (http://www.codeguru.com/forum/showthread.php?t=312453)... :cool: