home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / FILE_LK.ZIP / FILELOOK.CPP < prev    next >
C/C++ Source or Header  |  1993-12-18  |  3KB  |  131 lines

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