problem with _beginthread
Hello all,
is somebody could help me solve
problem with start of new thread?
I am trying to use
// Start new thread
ThreadHandle = _beginthread(TestThread, 4096, NULL);
from method of class Server. Proc function "TestThread"also is member of this class
where
void Server::TestThread(void *) {
logger.log2ScreenAndFile("Thread started");
}
1) I have error: 1>.\Server.cpp(183) : error C3867: 'Server::TestThread': function call missing argument list; use '&Server::TestThread' to create a pointer to member
Why I have to use &Server::TestThread?? not TestThread?
2) but ater _beginthread(&Server::TestThread, 4096, NULL);
I have next error C2664: '_beginthread' : cannot convert parameter 1 from 'void (__thiscall Server::* )(void *)' to 'void (__cdecl *)(void *)'
What is correct way to start thread??
Thanks a lot
|