sfought
April 22nd, 1999, 03:21 PM
I have an ActiveX control that uses a worker thread. I need the worker thread to be able to fire events for the control, so I am trying to declare the worker thread's function as a member of the class, but I am getting the following compiler error:
'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (void *)'
The code looks like this
// This is in the class declaration
private:
UINT WorkerThread(LPVOID pInfo);
// This is in one of the classes member functions
AfxBeginThread(WorkerThread, NULL, 0, 0, 0, NULL);
// And this is the way the actual function is defined
UINT MyClass::WorkerThread(LPVOID pInfo)
Is there a way that I can type-cast WorkerThread in the call to AfxBeginThread? Or is there a way I can have a non-member function fire the classes event? Has anyone run into this before?
Thanks,
sfought
'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (void *)'
The code looks like this
// This is in the class declaration
private:
UINT WorkerThread(LPVOID pInfo);
// This is in one of the classes member functions
AfxBeginThread(WorkerThread, NULL, 0, 0, 0, NULL);
// And this is the way the actual function is defined
UINT MyClass::WorkerThread(LPVOID pInfo)
Is there a way that I can type-cast WorkerThread in the call to AfxBeginThread? Or is there a way I can have a non-member function fire the classes event? Has anyone run into this before?
Thanks,
sfought