home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / MS_DAO.SDK / DISK4 / DAOSDK.1 / daoemp.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-07  |  3.4 KB  |  139 lines

  1. // DAOEMP.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "DAOEMP.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "DAOEMdoc.h"
  9. #include "DAOEMvw.h"
  10.  
  11. #ifdef _DEBUG
  12. #undef THIS_FILE
  13. static char BASED_CODE THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CDAOEMPApp
  18.  
  19. BEGIN_MESSAGE_MAP(CDAOEMPApp, CWinApp)
  20.     //{{AFX_MSG_MAP(CDAOEMPApp)
  21.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code!
  24.     //}}AFX_MSG_MAP
  25.     // Standard file based document commands
  26.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  27.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  28. END_MESSAGE_MAP()
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CDAOEMPApp construction
  32.  
  33. CDAOEMPApp::CDAOEMPApp()
  34. {
  35.     // TODO: add construction code here,
  36.     // Place all significant initialization in InitInstance
  37. }
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // The one and only CDAOEMPApp object
  41.  
  42. CDAOEMPApp theApp;
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CDAOEMPApp initialization
  46.  
  47. BOOL CDAOEMPApp::InitInstance()
  48. {
  49.     // Initialize OLE libraries
  50.     if (!AfxOleInit())
  51.     {
  52.         AfxMessageBox(IDP_OLE_INIT_FAILED);
  53.         return FALSE;
  54.     }
  55.     
  56.     // Standard initialization
  57.     // If you are not using these features and wish to reduce the size
  58.     //  of your final executable, you should remove from the following
  59.     //  the specific initialization routines you do not need.
  60.  
  61.     //BOOL b3D = Enable3dControls();
  62.     AfxEnableWin40Compatibility();
  63.  
  64.     LoadStdProfileSettings(0);  // Load standard INI file options (including MRU)
  65.  
  66.     // Register the application's document templates.  Document templates
  67.     //  serve as the connection between documents, frame windows and views.
  68.  
  69.     CSingleDocTemplate* pDocTemplate;
  70.     pDocTemplate = new CSingleDocTemplate(
  71.         IDR_MAINFRAME,
  72.         RUNTIME_CLASS(CDAOEMPDoc),
  73.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  74.         RUNTIME_CLASS(CDAOEMPView));
  75.     pDocTemplate->SetContainerInfo(IDR_CONTRTYPE_CNTR_IP);
  76.     AddDocTemplate(pDocTemplate);
  77.  
  78.     // create a new (empty) document
  79.     OnFileNew();
  80.  
  81.     if (m_lpCmdLine[0] != '\0')
  82.     {
  83.         // TODO: add command line processing here
  84.     }
  85.  
  86.     return TRUE;
  87. }
  88.  
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CAboutDlg dialog used for App About
  91.  
  92. class CAboutDlg : public CDialog
  93. {
  94. public:
  95.     CAboutDlg();
  96.  
  97. // Dialog Data
  98.     //{{AFX_DATA(CAboutDlg)
  99.     enum { IDD = IDD_ABOUTBOX };
  100.     //}}AFX_DATA
  101.  
  102. // Implementation
  103. protected:
  104.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  105.     //{{AFX_MSG(CAboutDlg)
  106.         // No message handlers
  107.     //}}AFX_MSG
  108.     DECLARE_MESSAGE_MAP()
  109. };
  110.  
  111. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  112. {
  113.     //{{AFX_DATA_INIT(CAboutDlg)
  114.     //}}AFX_DATA_INIT
  115. }
  116.  
  117. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  118. {
  119.     CDialog::DoDataExchange(pDX);
  120.     //{{AFX_DATA_MAP(CAboutDlg)
  121.     //}}AFX_DATA_MAP
  122. }
  123.  
  124. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  125.     //{{AFX_MSG_MAP(CAboutDlg)
  126.         // No message handlers
  127.     //}}AFX_MSG_MAP
  128. END_MESSAGE_MAP()
  129.  
  130. // App command to run the dialog
  131. void CDAOEMPApp::OnAppAbout()
  132. {
  133.     CAboutDlg aboutDlg;
  134.     aboutDlg.DoModal();
  135. }
  136.  
  137. /////////////////////////////////////////////////////////////////////////////
  138. // CDAOEMPApp commands
  139.