home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / dbeng / dbeng.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-11  |  3.5 KB  |  144 lines

  1. // dbeng.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "dbeng.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "dbengdoc.h"
  9. #include "dbengvw.h"
  10. #include "dbengsam.h"
  11.  
  12. #ifdef _DEBUG
  13. #undef THIS_FILE
  14. static char BASED_CODE THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CDbengApp
  19.  
  20. BEGIN_MESSAGE_MAP(CDbengApp, CWinApp)
  21.     //{{AFX_MSG_MAP(CDbengApp)
  22.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  23.     ON_COMMAND(ID_HELP_SAMPLEDIALOG, OnDBEngineSample)
  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. // CDbengApp construction
  32.  
  33. CDbengApp::CDbengApp()
  34. {
  35.     // TODO: add construction code here,
  36.     // Place all significant initialization in InitInstance
  37. }
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // The one and only CDbengApp object
  41.  
  42. CDbengApp NEAR theApp;
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CDbengApp initialization
  46.  
  47. BOOL CDbengApp::InitInstance()
  48. {
  49.     // Standard initialization
  50.     // If you are not using these features and wish to reduce the size
  51.     //  of your final executable, you should remove from the following
  52.     //  the specific initialization routines you do not need.
  53.  
  54.     SetDialogBkColor();        // set dialog background color to gray
  55.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  56.     EnableVBX();               // Initialize VBX support
  57.  
  58.     // Register the application's document templates.  Document templates
  59.     //  serve as the connection between documents, frame windows and views.
  60.  
  61.     AddDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME,
  62.             RUNTIME_CLASS(CDbengDoc),
  63.             RUNTIME_CLASS(CMainFrame),     // main SDI frame window
  64.             RUNTIME_CLASS(CDbengView)));
  65.  
  66.  
  67.     // create a new (empty) document
  68.     OnFileNew();
  69.  
  70.     if (m_lpCmdLine[0] != '\0')
  71.     {
  72.         // TODO: add command line processing here
  73.     }
  74.  
  75.     return TRUE;
  76. }
  77.  
  78. /////////////////////////////////////////////////////////////////////////////
  79. // CAboutDlg dialog used for App About
  80.  
  81. class CAboutDlg : public CDialog
  82. {
  83. public:
  84.     CAboutDlg();
  85.  
  86. // Dialog Data
  87.     //{{AFX_DATA(CAboutDlg)
  88.     enum { IDD = IDD_ABOUTBOX };
  89.     //}}AFX_DATA
  90.  
  91. // Implementation
  92. protected:
  93.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  94.     //{{AFX_MSG(CAboutDlg)
  95.         // No message handlers
  96.     //}}AFX_MSG
  97.     DECLARE_MESSAGE_MAP()
  98. };
  99.  
  100. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  101. {
  102.     //{{AFX_DATA_INIT(CAboutDlg)
  103.     //}}AFX_DATA_INIT
  104. }
  105.  
  106. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  107. {
  108.     CDialog::DoDataExchange(pDX);
  109.     //{{AFX_DATA_MAP(CAboutDlg)
  110.     //}}AFX_DATA_MAP
  111. }
  112.  
  113. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  114.     //{{AFX_MSG_MAP(CAboutDlg)
  115.         // No message handlers
  116.     //}}AFX_MSG_MAP
  117. END_MESSAGE_MAP()
  118.  
  119. // App command to run the dialog
  120. void CDbengApp::OnAppAbout()
  121. {
  122.     CAboutDlg aboutDlg;
  123.     aboutDlg.DoModal();
  124. }
  125.  
  126. /////////////////////////////////////////////////////////////////////////////
  127. // VB-Event registration
  128. // (calls to AfxRegisterVBEvent will be placed here by ClassWizard)
  129.  
  130. //{{AFX_VBX_REGISTER_MAP()
  131. //}}AFX_VBX_REGISTER_MAP
  132.  
  133. /////////////////////////////////////////////////////////////////////////////
  134. // CDbengApp commands
  135.  
  136. void CDbengApp::OnDBEngineSample()
  137. {
  138.     // TODO: Add your command handler code here
  139.     CDBENGSAMP DBENGDlg;
  140.     DBENGDlg.DoModal();
  141. }
  142.  
  143.  
  144.