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

Answers were Sorted based on User's Feedback



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

Answer / srinivas endra

No, One application does not contain more than one
application object.
Since, the program can defines a single global application
object, which can represent only one application.

One Application cannot have more than one object and can
represent more than one application. I can say, this cann't
happen and opposite to behavior.

Is This Answer Correct ?    3 Yes 1 No

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

Answer / bijender singh

No,one application can't have more than one object.
Because when we create the Application class object.It
calls WinMain() function & which calls AfxWinInit() to
register the window class, InitInstace() to start,show &
update the window.
Than calls the Run() function which call
CWinThread::MessagePump() for message loop.
Once it receive the WM_QUIT message it will call AfxWinTerm
() to cleanup & exit the application.

So once you create the Application object the Primary
thread will start which is called as UI Thread.
One program can have only one Main function which do all
the above mentioned job.
That's why we can create the one object only.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / abhijit

The CWinApp (derived) object is linked to the process'
primary thread. If for some reason we do indeed need two
objects then which will constitute the primary thread!! how
would the framework differentiate!!

Is This Answer Correct ?    1 Yes 0 No

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

Answer / swetha

An Application can not have more than one object.B'coz only
WinMain() fn will be there for per application.Application
class itself calls the WinMain() fn.So, if we create more
than one object more than one WinMain() will yield error
condition.Therefore one object for an application is
possible.

Is This Answer Correct ?    0 Yes 1 No

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

Answer / vivek

Yes one application can have more than one object.

Is This Answer Correct ?    1 Yes 12 No

Post New Answer

More MFC Interview Questions

If application hangs while SendMessage is waiting for the result, how you handle it?

2 Answers  


Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer

7 Answers   HP,


Differ GetMessage, PostMessage & PeakMessage?

4 Answers   Symphony,


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

1 Answers  


What is a critical section and how is it implemented?

2 Answers  






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

1 Answers   HCL,


What is the difference between workrer thread and UI thread

3 Answers   HCL,


what do you mean by psychic window?

2 Answers   Patni,


What is stack size in win32 program?

1 Answers   HCL,


How to convert a CString variable to char* or LPTSTR?

5 Answers   Dover,


What are the special requirements for dialog box resources used in a form view?

2 Answers  


What is LPCTSTR? What does LP denote it?

4 Answers  


Categories