home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / ript16 / sample / rtab_sam.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-16  |  3.5 KB  |  139 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. #include "..\include\rip_tabs.h"
  11.  
  12. #ifdef _DEBUG
  13. #undef THIS_FILE
  14. static char BASED_CODE THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CRtab_samApp
  19.  
  20. BEGIN_MESSAGE_MAP(CRtab_samApp, CWinApp)
  21.     //{{AFX_MSG_MAP(CRtab_samApp)
  22.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  23.         // NOTE - the ClassWizard will add and remove mapping macros here.
  24.         //    DO NOT EDIT what you see in these blocks of generated code !
  25.     //}}AFX_MSG_MAP
  26.     // Standard file based document commands
  27.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  28.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  29. END_MESSAGE_MAP()
  30.  
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CRtab_samApp construction
  33.  
  34. CRtab_samApp::CRtab_samApp()
  35. {
  36.     // TODO: add construction code here,
  37.     // Place all significant initialization in InitInstance
  38. }
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // The one and only CRtab_samApp object
  42.  
  43. CRtab_samApp NEAR theApp;
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CRtab_samApp initialization
  47.  
  48. BOOL CRtab_samApp::InitInstance()
  49. {
  50.     // Standard initialization
  51.     // If you are not using these features and wish to reduce the size
  52.     //  of your final executable, you should remove from the following
  53.     //  the specific initialization routines you do not need.
  54.  
  55.     RipTABRegister();
  56.     SetDialogBkColor();        // set dialog background color to gray
  57.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  58.  
  59.     // Register the application's document templates.  Document templates
  60.     //  serve as the connection between documents, frame windows and views.
  61.  
  62.     AddDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME,
  63.             RUNTIME_CLASS(CRtab_samDoc),
  64.             RUNTIME_CLASS(CMainFrame),     // main SDI frame window
  65.             RUNTIME_CLASS(CRtab_samView)));
  66.  
  67.  
  68.     // create a new (empty) document
  69.     OnFileNew();
  70.  
  71.     if (m_lpCmdLine[0] != '\0')
  72.     {
  73.         // TODO: add command line processing here
  74.     }
  75.  
  76.     BOOL ctl3dOK=Ctl3dRegister(AfxGetInstanceHandle());
  77.     Ctl3dAutoSubclass(AfxGetInstanceHandle());
  78.  
  79.     return TRUE;
  80. }
  81.  
  82. int CRtab_samApp::ExitInstance()
  83. {
  84.     RipTABUnregister();
  85.     Ctl3dUnregister(AfxGetInstanceHandle());
  86.     return 0;
  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 CRtab_samApp::OnAppAbout()
  132. {
  133.     CAboutDlg aboutDlg;
  134.     aboutDlg.DoModal();
  135. }
  136.  
  137. /////////////////////////////////////////////////////////////////////////////
  138. // CRtab_samApp commands
  139.