473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Diffence between CreateThread and AfxBeginThread

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
3 15762
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Liu Ju | last post by:
Dear members: I want to use the multithread in my program which is developed in Visual C++ platform (version 6). I created a controlling function: UINT CCOMM1Dlg::WritingThreadFunc(LPVOID...
2
by: Praveen | last post by:
Hi, Hi I am a newbie in DB2 and Mainframe.I would like to know if there is any diffence between the Quantified Predicates: IN , ANY, and SOME. Thank you very much for your valuable time. ...
1
by: phark52 | last post by:
My main app calls LoadLibrary() to load a DLL, which calls CreateThread(). This does NOT return NULL and I get a thread ID. However, ThreadProc never gets executed when this code is in the DLL. It...
5
by: Vinayak Raghuvamshi | last post by:
Threads created using the CreateThread API used to leak memory if you accesed any crt methods within the thread proc. we used to use _beginthread to work around this issue. Does anyone know if...
2
by: phenrol | last post by:
Hello, I am having issues getting my worker thread to function properly. I am working with visual c++ 6 and I am unsure that this is the correct forum to post in but I could not find another that...
3
by: mccanaveras | last post by:
Hello, I need to implement a Thread in a Visual C++ 6.0 application. I've never done this, then I've been investigating, but I don't have any properly solution. One of them is use CWinThread...
0
by: liamacheung | last post by:
Hi, I am designing a GUI application using a VC++ 2005 Form template. I have created a thread function external to the class containing the form. I can successfully create the thread and run...
5
by: eagerlearner | last post by:
Hallo, when I use class and I put one of the member function as the CreateThread argument, I keep getting the compile error in Visual Studio 2005. #include <windows.h> class X { public:...
3
by: sevak316 | last post by:
This must be an easy question. I am trying to create a thread in windows. I am using C as my language. I am trying to pass a function to the CreateThread function to create a thread. My...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.