Visual C++ and MFC Fundamentals Chapter 12: Dialog-Based Windows
CGeometryApp::CGeometryApp()
{
}/////////////////////////////////////////////////////////////////////////////
// The one and only CGeometryApp objectCGeometryApp theApp;/////////////////////////////////////////////////////////////////////////////
// CGeometryApp initializationBOOL CGeometryApp::InitInstance()
{
AfxEnableControlContainer();// Standard initialization#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a
shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endifCGeomeSheet GeoSheet("Geometric Calculations");CQuadrilateral Quad;
CCircular Circ;
CGeome3D G3D;GeoSheet.AddPage(&Quad);
GeoSheet.AddPage(&Circ);
GeoSheet.AddPage(&G3D);m_pMainWnd = &GeoSheet;
int nResponse = GeoSheet.DoModal();if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}- Test the application