what is the use of CWinApp class?
Answers were Sorted based on User's Feedback
Answer / gowri shankar
CWinApp is an application object provides member functions
for initializing your application (and each instance of it)
and for running the application.
Each application that uses the Microsoft Foundation classes
can only contain one object derived from CWinApp. This
object is constructed when other C++ global objects are
constructed and is already available when Windows calls the
WinMain function, which is supplied by the Microsoft
Foundation Class Library. Declare your derived CWinApp
object at the global level.
When you derive an application class from CWinApp, override
the InitInstance member function to create your
application's main window object.
In addition to the CWinApp member functions, the Microsoft
Foundation Class Library provides the following global
functions to access your CWinApp object and other global
information:
•AfxGetApp Obtains a pointer to the CWinApp object.
•AfxGetInstanceHandle Obtains a handle to the current
application instance.
•AfxGetResourceHandle Obtains a handle to the
application's resources.
•AfxGetAppName Obtains a pointer to a string containing
the application's name. Alternately, if you have a pointer
to the CWinApp object, use m_pszExeName to get the
application's name.
| Is This Answer Correct ? | 18 Yes | 2 No |
Answer / rck
It is used for providing application base address and for resource handling functions.
| Is This Answer Correct ? | 2 Yes | 2 No |
The base class from which you derive a Windows application object.
class CWinApp : public CWinThread
When you derive an application class from CWinApp, override the InitInstance member function to create your application's main window object.
1) AfxGetApp Obtains a pointer to the CWinApp object.
2) AfxGetInstanceHandle Obtains a handle to the current application instance.
3) AfxGetResourceHandle Obtains a handle to the application's resources.
4) AfxGetAppName Obtains a pointer to a string containing the application's name. Alternately, if you have a pointer to the CWinApp object, use m_pszExeName to get the application's name.
| Is This Answer Correct ? | 0 Yes | 1 No |
What is the base class for most MFC classes?
what is the component of CLR ?
i have created runtime menu -- ( admistrator ->managepackage,manage module). but now i want to open a dialog when i select manage package and any other diaolg when selecting manage module ( whole selection is at run time only ) . Please HELP .its urgently required
Whats is DDX & DDV in MFC?
Psychic Window Technique
How can we create thread in MFC framework?
How to create a Modeless Dialog?
1)why we cant create more than one instance of the class Derived from CWinApp
What is a message map?
Have you ever used win32 APIs ?
What are the advantages of using Doc/View or SDI over DialogBox
if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?