Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can we create thread in MFC framework?

Answers were Sorted based on User's Feedback



How can we create thread in MFC framework?..

Answer / nageswara rao.y

AfxBeginThread() ,
CreateThread()

Is This Answer Correct ?    7 Yes 2 No

How can we create thread in MFC framework?..

Answer / bijender singh

MFC support two type of thread : Worker Thread & UI thread.
There is an overloaded function called AfxBeginThread()for
creating threads in MFC but at APT level you can't
differentaite.
At implementation level you can find the difference:-

For worker thread:
AfxBeginThread(); It takes 6 parameters, first param as
address of thread controlling function(must),2nd as
parameter passed to threadfn(must),3'rd thread priority
level(optional), 4'th as stack size(Optional),5'th as
create_flag(optional),6'th security class(optional)etc.

For UI(User Interface) thread:
Derive a class from CWinThread;
class CMyThread:public CWinThread
{
.....
.....
.....
}
Override the InitInstance() function in this class.

Then use the function
AfxBeginThread()and pass the parameter in RUNTIME_CLASS
macro in this func.
i.e. AfxBeginThread(RUNTIME_CLASS(CMyThread));
It takes 5 parameters ...rest of last four params are same
as worker thread which are optional.

So in this you can create the Worker and User Interface
threads.

Is This Answer Correct ?    5 Yes 2 No

How can we create thread in MFC framework?..

Answer / jianhua wang

For worker thread:
AfxBeginThread();

for user interface thread:
Derive a class from CWinThread;
AfxBeginThread(); (Another version)
//if the thread is created in a suspended state, you must call
CWinThread::ResumeThread();

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More MFC Interview Questions

How many types of combo box are their

2 Answers   Aaditya Info Solutions, E Logic,


What is difference between the TCP/IP and UDP socket

5 Answers   Invensys,


Why not virtual functions to handle messages?

5 Answers  


Which MFC function is used to display output?

9 Answers   TCS,


1)How to change a text of a button as Dynamically?

1 Answers   HCL,


Explain StretchBlt and BitBlt

1 Answers  


How to handle RTTI in MFC ?

1 Answers  


how to give colour for dialog button or static buuto?any one explain full code ?pls pls

3 Answers  


What view class enables you to use an edit control as a view?

1 Answers  


Do you have an idea about MFC?

0 Answers   C DAC, CDAC,


Explain the flow of SDI application?

8 Answers   Mphasis,


Does the application have more than one object? If no, then what is the reason?

5 Answers  


Categories