Re: SuspendThread() problem
On Fri, 10 Aug 2007 12:40:49 -0700, "Michael K. O'Neill"
<MikeAThon2000@nospam.hotmail.com> wrote:
"Scoots" <linkingfire@msn.com> wrote in message
news:1186756765.016660.182240@q4g2000prc.googlegroups.com...
Solved. Thanks for looking.
The afxBeginThread I was using wasn't initializing the CWinThread base
of the derived object, and so the local m_hThread was never being
set. By adding a local handle and removing the derivation, I can
SuspendThread(handle) now.
A thread should ordinarily not use SuspendThread() to suspend itself. The
SuspendThread() function is primarily a debugging function, which the
debugger can use to suspend threads that are being debugged (and to resume
them with ResumeThread()). Thus, SuspendThread should usually be used only
by a debugging thread, to suspend a target thread, and not by the target
thread itself.
<snip>
Yes, this thread would be better titled, "SuspendThread() is a problem.
Don't use it."
--
Doug Harrison
Visual C++ MVP