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

1)how to Display the File Dialog Box, in MFC ?

1 Answers  


if both base and derived class have the constructors if i create an object for derive class which class constructor is executed first

10 Answers   Siemens, Symphony,


Explain StretchBlt and BitBlt

1 Answers  


What is the command routing in MFC framework?

3 Answers  


How to handle RTTI in MFC ?

1 Answers  






What is stack size in win32 program?

1 Answers   HCL,


1.Get string1,string2,string3 1.add string1 and 2,string1 and 3. 2.replace vowels with T 3.count number of T. 4.remove T 5.COPY string1 to stringf. 6.restore string1. print the following 1.Number of T 2.StringF 3.string1+string2+string3 Use pointers and functions

1 Answers  


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

2 Answers  


Name the Synchronization objects?

2 Answers  


1)set the Title for The File DialogBox, in MFC?

1 Answers  


Does the application have more than one object? If Yes, Briefly explain.

2 Answers   Soltius Infotech,


what is the use of AFX_MANAGE_STATE ?

4 Answers   HCL,


Categories