home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / ript32 / sample / rtab_sam.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-21  |  3.4 KB  |  136 lines

  1. // rtab_sam.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "rtab_sam.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "rtab_doc.h"
  9. #include "rtab_vw.h"
  10.  
  11. #ifdef _DEBUG
  12. #undef THIS_FILE
  13. static char BASED_CODE THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CRtab_samApp
  18.  
  19. BEGIN_MESSAGE_MAP(CRtab_samApp, CWinApp)
  20.     //{{AFX_MSG_MAP(CRtab_samApp)
  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. // CRtab_samApp construction
  32.  
  33. CRtab_samApp::CRtab_samApp()
  34. {
  35.     // TODO: add construction code here,
  36.     // Place all significant initialization in InitInstance
  37. }
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // The one and only CRtab_samApp object
  41.  
  42. CRtab_samApp NEAR theApp;
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CRtab_samApp initialization
  46.  
  47. BOOL CRtab_samApp::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.  
  57.     // Register the application's document templates.  Document templates
  58.     //  serve as the connection between documents, frame windows and views.
  59.  
  60.     AddDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME,
  61.             RUNTIME_CLASS(CRtab_samDoc),
  62.             RUNTIME_CLASS(CMainFrame),     // main SDI frame window
  63.             RUNTIME_CLASS(CRtab_samView)));
  64.  
  65.  
  66.     // create a new (empty) document
  67.     OnFileNew();
  68.  
  69.     if (m_lpCmdLine[0] != '\0')
  70.     {
  71.         // TODO: add command line processing here
  72.     }
  73.  
  74.     BOOL ctl3dOK=Ctl3dRegister(AfxGetInstanceHandle());
  75.     Ctl3dAutoSubclass(AfxGetInstanceHandle());
  76.  
  77.     return TRUE;
  78. }
  79.  
  80. int CRtab_samApp::ExitInstance()
  81. {
  82.     Ctl3dUnregister(AfxGetInstanceHandle());
  83.     return 0;
  84. }
  85.  
  86. /////////////////////////////////////////////////////////////////////////////
  87. // CAboutDlg dialog used for App About
  88.  
  89. class CAboutDlg : public CDialog
  90. {
  91. public:
  92.     CAboutDlg();
  93.  
  94. // Dialog Data
  95.     //{{AFX_DATA(CAboutDlg)
  96.     enum { IDD = IDD_ABOUTBOX };
  97.     //}}AFX_DATA
  98.  
  99. // Implementation
  100. protected:
  101.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  102.     //{{AFX_MSG(CAboutDlg)
  103.         // No message handlers
  104.     //}}AFX_MSG
  105.     DECLARE_MESSAGE_MAP()
  106. };
  107.  
  108. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  109. {
  110.     //{{AFX_DATA_INIT(CAboutDlg)
  111.     //}}AFX_DATA_INIT
  112. }
  113.  
  114. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  115. {
  116.     CDialog::DoDataExchange(pDX);
  117.     //{{AFX_DATA_MAP(CAboutDlg)
  118.     //}}AFX_DATA_MAP
  119. }
  120.  
  121. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  122.     //{{AFX_MSG_MAP(CAboutDlg)
  123.         // No message handlers
  124.     //}}AFX_MSG_MAP
  125. END_MESSAGE_MAP()
  126.  
  127. // App command to run the dialog
  128. void CRtab_samApp::OnAppAbout()
  129. {
  130.     CAboutDlg aboutDlg;
  131.     aboutDlg.DoModal();
  132. }
  133.  
  134. /////////////////////////////////////////////////////////////////////////////
  135. // CRtab_samApp commands
  136.