I want to create a worker thread but i recive an error like this:
my code:
UINT ReadCD(LPVOID lp)
{
.//Some Code//
.
.
return0;
}
.
.
.
AfxBeginThread(ReadCD,NULL);
Error:"error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (void *)"

I have a problem with AfxBeginThread()
Nassir
UINT __cdecl ReadCD(void *)
{
return 0;
}
It works for me! I can even omit __cdecl because it the default in my project!
warelock
UINT __cdecl ReadCD(LPVOID lp)
{
// ...
}
Glenn W Johnson
He3117, could you post the full error message (if you're building from within the IDE make sure, that you get the error message from the output window and _not_ from the task list/error window). With VC8 you should get you a good error message (good work VC++ FE folks, BTW
-hg
B.a.G.
Ben Anderson
Thanks,
Ayman Shoukry
VC++ Team
mchf
PowerCopyDlg.cpp
D:\Tools\Visuall C++\PowerCopy\PowerCopyDlg.cpp(384) : error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (void *)'
Error executing cl.exe.
PowerCopy.exe - 1 error(s), 0 warning(s)
My code:
AfxBeginThread(ReadCD,NULL);
Atrias
I try others.But they not work.
I doomed. :(
Maxwell0star
TRAIN MAN
willajo
static UINT foo(LPVOID poi)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
return 0;
}
CWinThread* pWinThread = AfxBeginThread(foo);
should work!
The function must be static !!!!
R
Kavita Kamani
Scott Nonnenberg
unsigned int __cdecl ReadCD(void* pv)
{
}
FlatWhite
But!!!!
I Have a new problem now.
I Cant use my public members(functions or variables) in this function.
look at this:
illegal reference to data member 'CPowerCopyDlg::m_rbuf' in a static member function
Now it send me 204 errors like this!!!