home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / object10 / vsdept2.cpp < prev    next >
C/C++ Source or Header  |  1994-08-17  |  4KB  |  143 lines

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