Diffence between CreateThread and AfxBeginThread

R

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
 
G

Geo

raj said:
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.
 
B

benben

raj said:
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
 
C

Csaba

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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top