By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

Diffence between CreateThread and AfxBeginThread

P: n/a
raj
Hi,
I just want to know the difference between thread created by
CreateThread and AfxBeginThread function. I got one problem when using
the CreateThread. The appliction malfunction while using the
CreateThread. So is that a problem with this function?

Thanks in advance
Rajat

Dec 8 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Geo

raj wrote:
Hi,
I just want to know the difference between thread created by
CreateThread and AfxBeginThread function. I got one problem when using
the CreateThread. The appliction malfunction while using the
CreateThread. So is that a problem with this function?

Thanks in advance
Rajat


Standard C++ has no notion of, nor support for threads in any way, you
would be better of in an OS specific newsgroup.

Dec 8 '05 #2

P: n/a
raj wrote:
Hi,
I just want to know the difference between thread created by
CreateThread and AfxBeginThread function. I got one problem when using
the CreateThread. The appliction malfunction while using the
CreateThread. So is that a problem with this function?

Thanks in advance
Rajat


The former is a system call API and the latter is an equivalent that
works together with the MFC framework.

Ben
Dec 8 '05 #3

P: n/a
"raj" <ra*****@gmail.com> wrote in news:1134049498.646468.220340
@g44g2000cwa.googlegroups.com:
Hi,
I just want to know the difference between thread created by
CreateThread and AfxBeginThread function. I got one problem when using
the CreateThread. The appliction malfunction while using the
CreateThread. So is that a problem with this function?

Thanks in advance
Rajat


In microsoft.public.vc.mfc they could have told you that

AfxBeginThread sets up MFC stuff, then calls
_beginthreadex which sets up CRT stuff, then calls
::CreateThread, which is a Win32 API and really creates the thread.

MFC has all kinds of data structures which need to be switched on a per-
thread basis. AfxBeginThread takes care of setting this up. If you call
::CreateThread "behind the back" of MFC, things will not work.

Now, what was your C++ question ?

--
Life is complex, with real and imaginary parts.
Dec 14 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.