I'm a bit desperate. I'd like to call an object method via CreateThread. Therefore I started writing a simple template wrapper class. But at the key position I'm getting an Access Violation Error.
The following works:
You may call me idiot :D Thread_Wrapper<Server> wrap(this, &Server::wait_for_clients);
I placed the object on the stack :D Therefore the object was destroyed before the concurrent thread could invoke the required method...
Works fine if I place the object on the heap or if i give it a global scope :)