home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / PROPVIEW.ZIP / DevStudio / MyProjects / MdLessPpsh / MdLessPpsh.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-21  |  4.4 KB  |  163 lines

  1. // MdLessPpsh.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MdLessPpsh.h"
  6.  
  7. #include "MainFrm.h"
  8. #include "Pg1.h"
  9. #include "Pg2.h"
  10. #include "ModelessPpsh.h"
  11. #include "ChildFrm.h"
  12. #include "MdLessPpshDoc.h"
  13. #include "MdLessPpshView.h"
  14.  
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20.  
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CMdLessPpshApp
  23.  
  24. BEGIN_MESSAGE_MAP(CMdLessPpshApp, CWinApp)
  25.     //{{AFX_MSG_MAP(CMdLessPpshApp)
  26.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  27.         // NOTE - the ClassWizard will add and remove mapping macros here.
  28.         //    DO NOT EDIT what you see in these blocks of generated code!
  29.     //}}AFX_MSG_MAP
  30.     // Standard file based document commands
  31.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  32.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  33.     // Standard print setup command
  34.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  35. END_MESSAGE_MAP()
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CMdLessPpshApp construction
  39.  
  40. CMdLessPpshApp::CMdLessPpshApp()
  41. {
  42.     // TODO: add construction code here,
  43.     // Place all significant initialization in InitInstance
  44. }
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // The one and only CMdLessPpshApp object
  48.  
  49. CMdLessPpshApp theApp;
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CMdLessPpshApp initialization
  53.  
  54. BOOL CMdLessPpshApp::InitInstance()
  55. {
  56.     AfxEnableControlContainer();
  57.  
  58.     // Standard initialization
  59.     // If you are not using these features and wish to reduce the size
  60.     //  of your final executable, you should remove from the following
  61.     //  the specific initialization routines you do not need.
  62.  
  63. #ifdef _AFXDLL
  64.     Enable3dControls();            // Call this when using MFC in a shared DLL
  65. #else
  66.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  67. #endif
  68.  
  69.     // Change the registry key under which our settings are stored.
  70.     // You should modify this string to be something appropriate
  71.     // such as the name of your company or organization.
  72.     SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  73.  
  74.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  75.  
  76.     // Register the application's document templates.  Document templates
  77.     //  serve as the connection between documents, frame windows and views.
  78.  
  79.     CMultiDocTemplate* pDocTemplate;
  80.     pDocTemplate = new CMultiDocTemplate(
  81.         IDR_MDLESSTYPE,
  82.         RUNTIME_CLASS(CMdLessPpshDoc),
  83.         RUNTIME_CLASS(CChildFrame), // custom MDI child frame
  84.         RUNTIME_CLASS(CMdLessPpshView));
  85.     AddDocTemplate(pDocTemplate);
  86.  
  87.     // create main MDI Frame window
  88.     CMainFrame* pMainFrame = new CMainFrame;
  89.     if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  90.         return FALSE;
  91.     m_pMainWnd = pMainFrame;
  92.  
  93.     // Parse command line for standard shell commands, DDE, file open
  94.     CCommandLineInfo cmdInfo;
  95.     ParseCommandLine(cmdInfo);
  96.  
  97.     // Dispatch commands specified on the command line
  98.     if (!ProcessShellCommand(cmdInfo))
  99.         return FALSE;
  100.  
  101.     // The main window has been initialized, so show and update it.
  102.     pMainFrame->ShowWindow(m_nCmdShow);
  103.     pMainFrame->UpdateWindow();
  104.  
  105.     return TRUE;
  106. }
  107.  
  108. /////////////////////////////////////////////////////////////////////////////
  109. // CAboutDlg dialog used for App About
  110.  
  111. class CAboutDlg : public CDialog
  112. {
  113. public:
  114.     CAboutDlg();
  115.  
  116. // Dialog Data
  117.     //{{AFX_DATA(CAboutDlg)
  118.     enum { IDD = IDD_ABOUTBOX };
  119.     //}}AFX_DATA
  120.  
  121.     // ClassWizard generated virtual function overrides
  122.     //{{AFX_VIRTUAL(CAboutDlg)
  123.     protected:
  124.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  125.     //}}AFX_VIRTUAL
  126.  
  127. // Implementation
  128. protected:
  129.     //{{AFX_MSG(CAboutDlg)
  130.         // No message handlers
  131.     //}}AFX_MSG
  132.     DECLARE_MESSAGE_MAP()
  133. };
  134.  
  135. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  136. {
  137.     //{{AFX_DATA_INIT(CAboutDlg)
  138.     //}}AFX_DATA_INIT
  139. }
  140.  
  141. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  142. {
  143.     CDialog::DoDataExchange(pDX);
  144.     //{{AFX_DATA_MAP(CAboutDlg)
  145.     //}}AFX_DATA_MAP
  146. }
  147.  
  148. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  149.     //{{AFX_MSG_MAP(CAboutDlg)
  150.         // No message handlers
  151.     //}}AFX_MSG_MAP
  152. END_MESSAGE_MAP()
  153.  
  154. // App command to run the dialog
  155. void CMdLessPpshApp::OnAppAbout()
  156. {
  157.     CAboutDlg aboutDlg;
  158.     aboutDlg.DoModal();
  159. }
  160.  
  161. /////////////////////////////////////////////////////////////////////////////
  162. // CMdLessPpshApp commands
  163.