home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / zstud1 / zdemo.cp_ / ZDEMO.CPP
Encoding:
C/C++ Source or Header  |  1994-04-09  |  3.8 KB  |  135 lines

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