Doug
Wed Apr 16 20:14:07 CDT 2008
On Wed, 16 Apr 2008 17:34:24 -0700, Jim Johnson <aopiyy001@yahoo.com>
wrote:
>why if I have used MFC in my EXE - then I cannot use
>
>_beginthread / _beginthreadex?
>
>to create a thread?
>
>I seem to hear someone said so earlier...
If your thread uses MFC, it's best to use AfxBeginThread, and for some
guidance on using it correctly, see:
http://members.cox.net/doug_web/threads.htm
Also, the existence of _beginthread should be ignored; always use
_beginthreadex instead of _beginthread, because the former returns the
thread handle and doesn't auto-delete it. That's important for the same
reasons as described in Q1 and Q2 in the cited article.
--
Doug Harrison
Visual C++ MVP