Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 12: Dialog-Based Windows


CGeometryApp::CGeometryApp()
{
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CGeometryApp object

CGeometryApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CGeometryApp initialization

BOOL 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
#endif

CGeomeSheet 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;
}


  1. Test the application

Free download pdf