1)why we cant create more than one instance of the class
Derived from CWinApp

Answers were Sorted based on User's Feedback



1)why we cant create more than one instance of the class Derived from CWinApp ..

Answer / shanmuga

Becoz,through the CWinApp object only ,the application
starts.. If there exist more than one object there occurs a
conflict to proceed with which object.

Is This Answer Correct ?    6 Yes 1 No

1)why we cant create more than one instance of the class Derived from CWinApp ..

Answer / narayan

You theApp object is replace with new name;

Eg

CdlgtestApp theApp;
CdlgtestApp theApp3; // now this is your applcation obj

CdlgtestApp theApp3;
CdlgtestApp theApp; // No effect

Is This Answer Correct ?    6 Yes 4 No

1)why we cant create more than one instance of the class Derived from CWinApp ..

Answer / jdp

Because the CWinApp class encapsulates the main() method
which, as you know, there can be only one instance of in
any application.

Is This Answer Correct ?    0 Yes 0 No

1)why we cant create more than one instance of the class Derived from CWinApp ..

Answer / deepesh

because in constructor of CWinApp class
if it will called twice
ASSERT(AfxGetThread() == NULL);
will cause run time assertion

Is This Answer Correct ?    0 Yes 0 No

1)why we cant create more than one instance of the class Derived from CWinApp ..

Answer / sirama

Because MFC implemented it as Singleton CWinApp::Ctor.

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More MFC Interview Questions

What is Multithreading

1 Answers   Invensys,


what is the use of CCmdTarget?

4 Answers   Siemens,


What?s the difference between Modal and Modeless Dialog?

12 Answers   Jekson, Usl India,


Do you have an idea about MFC?

1 Answers   C DAC, CDAC,


visual Pogramming c++ coding for create a paint application.. (Please someone help me)

2 Answers  


What is the size of class

18 Answers   Aircom,


List out the parameters of WinMain Function.

2 Answers   Mphasis,


1)How to change the size of a button at run time ?

1 Answers  


What are the types of button controls?

10 Answers  


What are the differences between MFC Exception macros and C++ exception keywords?

2 Answers  


19)how to set Back Ground Picture to a Dialog Box in MFC ?

1 Answers  


What is the difference between Synchronous sockets and asynchronous sockets?

2 Answers  


Categories