1)why we cant create more than one instance of the class
Derived from CWinApp
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Answer / sirama
Because MFC implemented it as Singleton CWinApp::Ctor.
| Is This Answer Correct ? | 2 Yes | 7 No |
how does the UIThread and worker thread communicates and handle events
if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?
What is the difference between the SDI and MDI
How to handle dynamic menus in MFC?
What is model and modeless dialog box ? Give some examples?
What is the base class for most MFC classes?
What is the difference between ASSERT and VERIFY?
General purpose classes in MFC
how u can move CDC pointer to one line in cview?
I want recent paper pattern for HP company?
I can i set size of integer variable should be fixed for different operating systems(Ex i want integer size is 2bytes in OS)
List out the parameters of WinMain Function.