home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / CATALG2.PAK / CATALOG2.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  4.0 KB  |  148 lines

  1. // catalog2.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. // This is a part of the Microsoft Foundation Classes C++ library.
  5. // Copyright (C) 1992-1995 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // Microsoft Foundation Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding the
  12. // Microsoft Foundation Classes product.
  13.  
  14. #include "stdafx.h"
  15. #include "catalog2.h"
  16.  
  17. #include "MainFrm.h"
  18. #include "catsets.h"
  19. #include "cat2Doc.h"
  20. #include "cat2View.h"
  21.  
  22. #ifdef _DEBUG
  23. #undef THIS_FILE
  24. static char THIS_FILE[] = __FILE__;
  25. #endif
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CCatalog2App
  29.  
  30. BEGIN_MESSAGE_MAP(CCatalog2App, CWinApp)
  31.     //{{AFX_MSG_MAP(CCatalog2App)
  32.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  33.         // NOTE - the ClassWizard will add and remove mapping macros here.
  34.         //    DO NOT EDIT what you see in these blocks of generated code!
  35.     //}}AFX_MSG_MAP
  36.     // Standard file based document commands
  37.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  38.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  39. END_MESSAGE_MAP()
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CCatalog2App construction
  43.  
  44. CCatalog2App::CCatalog2App()
  45. {
  46.     // TODO: add construction code here,
  47.     // Place all significant initialization in InitInstance
  48. }
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // The one and only CCatalog2App object
  52.  
  53. CCatalog2App theApp;
  54.  
  55. // Register the application's document templates.  Document templates
  56. //  serve as the connection between documents, frame windows and views.
  57. static CSingleDocTemplate DocTemplate(
  58.         IDR_MAINFRAME,
  59.         RUNTIME_CLASS(CCatalog2Doc),
  60.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  61.         RUNTIME_CLASS(CCatalog2View));
  62.  
  63. /////////////////////////////////////////////////////////////////////////////
  64. // CCatalog2App initialization
  65.  
  66. BOOL CCatalog2App::InitInstance()
  67. {
  68.     // Standard initialization
  69.     // If you are not using these features and wish to reduce the size
  70.     //  of your final executable, you should remove from the following
  71.     //  the specific initialization routines you do not need.
  72.  
  73. #ifdef _AFXDLL
  74.     Enable3dControls();            // Call this when using MFC in a shared DLL
  75. #else
  76.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  77. #endif
  78.  
  79.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  80.  
  81.  
  82.     // Parse command line for standard shell commands, DDE, file open
  83.     CCommandLineInfo cmdInfo;
  84.     ParseCommandLine(cmdInfo);
  85.  
  86.     // Dispatch commands specibfied on the command line
  87.     if (!ProcessShellCommand(cmdInfo))
  88.         return FALSE;
  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.     // ClassWizard generated virtual function overrides
  107.     //{{AFX_VIRTUAL(CAboutDlg)
  108.     protected:
  109.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  110.     //}}AFX_VIRTUAL
  111.  
  112. // Implementation
  113. protected:
  114.     //{{AFX_MSG(CAboutDlg)
  115.         // No message handlers
  116.     //}}AFX_MSG
  117.     DECLARE_MESSAGE_MAP()
  118. };
  119.  
  120. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  121. {
  122.     //{{AFX_DATA_INIT(CAboutDlg)
  123.     //}}AFX_DATA_INIT
  124. }
  125.  
  126. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  127. {
  128.     CDialog::DoDataExchange(pDX);
  129.     //{{AFX_DATA_MAP(CAboutDlg)
  130.     //}}AFX_DATA_MAP
  131. }
  132.  
  133. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  134.     //{{AFX_MSG_MAP(CAboutDlg)
  135.         // No message handlers
  136.     //}}AFX_MSG_MAP
  137. END_MESSAGE_MAP()
  138.  
  139. // App command to run the dialog
  140. void CCatalog2App::OnAppAbout()
  141. {
  142.     CAboutDlg aboutDlg;
  143.     aboutDlg.DoModal();
  144. }
  145.  
  146. /////////////////////////////////////////////////////////////////////////////
  147. // CCatalog2App commands
  148.