VC++: CWinThread for simple threads
Posted on 1998-07-16
I'd like to use CWinThread to create a simple, worker thread. I've used AfxBeginThread in the past, but CWinThread seems more encapsulated. This is probably really easy, but as usual the documentation in Visual C is horrible and I can't make heads or tails out of it.
What I'm doing is creating a derivation of CWinThread called CThinker with an overridden Run(). Whenever I want a thread I create a new CThinker object and call CreateThread, which returns TRUE, but somehow my Run() function never gets called.
What am I doing wrong? If this turns out to be more complicated then I think, I will add points.