01: // CTPuzzle.cpp : Defines the class behaviors for the application. 02: // 03: 04: #include "stdafx.h" 05: #include "CTPuzzle.h" 06: #include "CTPuzzleDlg.h" 07: 08: #ifdef _DEBUG 09: #define new DEBUG_NEW 10: #undef THIS_FILE 11: static char THIS_FILE[] = __FILE__; 12: #endif 13: 14: ///////////////////////////////////////////////////////////////////////////// 15: // CCTPuzzleApp 16: 17: BEGIN_MESSAGE_MAP(CCTPuzzleApp, CWinApp) 18: //{{AFX_MSG_MAP(CCTPuzzleApp) 19: // NOTE - the ClassWizard will add and remove mapping macros here. 20: // DO NOT EDIT what you see in these blocks of generated code! 21: //}}AFX_MSG 22: ON_COMMAND(ID_HELP, CWinApp::OnHelp) 23: END_MESSAGE_MAP() 24: 25: ///////////////////////////////////////////////////////////////////////////// 26: // CCTPuzzleApp construction 27: 28: CCTPuzzleApp::CCTPuzzleApp() 29: { 30: // TODO: add construction code here, 31: // Place all significant initialization in InitInstance 32: } 33: 34: ///////////////////////////////////////////////////////////////////////////// 35: // The one and only CCTPuzzleApp object 36: 37: CCTPuzzleApp theApp; 38: 39: ///////////////////////////////////////////////////////////////////////////// 40: // CCTPuzzleApp initialization 41: 42: BOOL CCTPuzzleApp::InitInstance() 43: { 44: // Standard initialization 45: // If you are not using these features and wish to reduce the size 46: // of your final executable, you should remove from the following 47: // the specific initialization routines you do not need. 48: 49: #ifdef _AFXDLL 50: Enable3dControls(); // Call this when using MFC in a shared DLL 51: #else 52: Enable3dControlsStatic(); // Call this when linking to MFC statically 53: #endif 54: 55: CCommandLineInfo theCmdLn; 56: 57: ParseCommandLine(theCmdLn); 58: 59: CCTPuzzleDlg dlg; 60: 61: if (theCmdLn.m_nShellCommand==CCommandLineInfo::FileOpen) 62: dlg.PrepareDialog(theCmdLn.m_strFileName); 63: 64: m_pMainWnd = &dlg; 65: int nResponse = dlg.DoModal(); 66: if (nResponse == IDOK) 67: { 68: // TODO: Place code here to handle when the dialog is 69: // dismissed with OK 70: } 71: else if (nResponse == IDCANCEL) 72: { 73: // TODO: Place code here to handle when the dialog is 74: // dismissed with Cancel 75: } 76: 77: // Since the dialog has been closed, return FALSE so that we exit the 78: // application, rather than start the application's message pump. 79: return FALSE; 80: }