home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / vbasic / Data / Utils / XZipComp.exe / XceedZip.Cab / F112500_StartedDlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-12  |  16.8 KB  |  542 lines

  1. // StartedDlg.cpp : implementation file
  2. //
  3. // This file is part of the Xceed Zip 4 "Getting Started" sample using MFC
  4. // Copyright (c) 1998-1999 Xceed Software Inc.
  5. //
  6.  
  7. #include "stdafx.h"
  8. #include "Started.h"
  9. #include "StartedDlg.h"
  10.  
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CAboutDlg dialog used for App About
  19.  
  20. class CAboutDlg : public CDialog
  21. {
  22. public:
  23.     CAboutDlg();
  24.  
  25. // Dialog Data
  26.     //{{AFX_DATA(CAboutDlg)
  27.     enum { IDD = IDD_ABOUTBOX };
  28.     //}}AFX_DATA
  29.  
  30.     // ClassWizard generated virtual function overrides
  31.     //{{AFX_VIRTUAL(CAboutDlg)
  32.     protected:
  33.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  34.     //}}AFX_VIRTUAL
  35.  
  36. // Implementation
  37. protected:
  38.     //{{AFX_MSG(CAboutDlg)
  39.     //}}AFX_MSG
  40.     DECLARE_MESSAGE_MAP()
  41. };
  42.  
  43. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  44. {
  45.     //{{AFX_DATA_INIT(CAboutDlg)
  46.     //}}AFX_DATA_INIT
  47. }
  48.  
  49. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  50. {
  51.     CDialog::DoDataExchange(pDX);
  52.     //{{AFX_DATA_MAP(CAboutDlg)
  53.     //}}AFX_DATA_MAP
  54. }
  55.  
  56. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  57.     //{{AFX_MSG_MAP(CAboutDlg)
  58.         // No message handlers
  59.     //}}AFX_MSG_MAP
  60. END_MESSAGE_MAP()
  61.  
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CStartedDlg dialog
  64.  
  65. CStartedDlg::CStartedDlg(CWnd* pParent /*=NULL*/)
  66.     : CDialog(CStartedDlg::IDD, pParent)
  67. {
  68.     //{{AFX_DATA_INIT(CStartedDlg)
  69.     m_bPreserve = TRUE;
  70.     m_bSubfolders = TRUE;
  71.     m_bUseTemp = TRUE;
  72.     m_sFilesToExclude = _T("");
  73.     m_sFilesToProcess = _T("");
  74.     m_sUnzipFolder = _T("");
  75.     m_sZipFilename = _T("");
  76.     //}}AFX_DATA_INIT
  77.     // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
  78.     m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  79. }
  80.  
  81. void CStartedDlg::DoDataExchange(CDataExchange* pDX)
  82. {
  83.     CDialog::DoDataExchange(pDX);
  84.     //{{AFX_DATA_MAP(CStartedDlg)
  85.     DDX_Control(pDX, IDC_PR_STATUS, m_prStatus);
  86.     DDX_Control(pDX, IDC_L_RESULTS, m_lstResults);
  87.     DDX_Control(pDX, IDC_CB_LEVEL, m_cbLevel);
  88.     DDX_Control(pDX, IDC_Z_XCEED, m_xZip);
  89.     DDX_Check(pDX, IDC_C_PRESERVE, m_bPreserve);
  90.     DDX_Check(pDX, IDC_C_SUBFOLDERS, m_bSubfolders);
  91.     DDX_Check(pDX, IDC_C_TEMP, m_bUseTemp);
  92.     DDX_Text(pDX, IDC_E_FILESTOEXCLUDE, m_sFilesToExclude);
  93.     DDX_Text(pDX, IDC_E_FILESTOPROCESS, m_sFilesToProcess);
  94.     DDX_Text(pDX, IDC_E_UNZIPFOLDER, m_sUnzipFolder);
  95.     DDX_Text(pDX, IDC_E_ZIPFILENAME, m_sZipFilename);
  96.     //}}AFX_DATA_MAP
  97. }
  98.  
  99. BEGIN_MESSAGE_MAP(CStartedDlg, CDialog)
  100.     //{{AFX_MSG_MAP(CStartedDlg)
  101.     ON_WM_SYSCOMMAND()
  102.     ON_WM_PAINT()
  103.     ON_WM_QUERYDRAGICON()
  104.     ON_BN_CLICKED(IDOK, OnQuit)
  105.     ON_BN_CLICKED(IDC_B_ZIP, OnZip)
  106.     ON_BN_CLICKED(IDC_B_UNZIP, OnUnzip)
  107.     ON_BN_CLICKED(IDC_B_TEST, OnTest)
  108.     ON_BN_CLICKED(IDC_B_LIST, OnList)
  109.     ON_BN_CLICKED(IDC_B_PREVIEW, OnPreview)
  110.     //}}AFX_MSG_MAP
  111. END_MESSAGE_MAP()
  112.  
  113. /////////////////////////////////////////////////////////////////////////////
  114. // CStartedDlg message handlers
  115.  
  116. BOOL CStartedDlg::OnInitDialog()
  117. {
  118.     CDialog::OnInitDialog();
  119.  
  120.     // Add "About..." menu item to system menu.
  121.  
  122.     // IDM_ABOUTBOX must be in the system command range.
  123.     ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
  124.     ASSERT(IDM_ABOUTBOX < 0xF000);
  125.  
  126.     CMenu* pSysMenu = GetSystemMenu(FALSE);
  127.     CString strAboutMenu;
  128.     strAboutMenu.LoadString(IDS_ABOUTBOX);
  129.     if (!strAboutMenu.IsEmpty())
  130.     {
  131.         pSysMenu->AppendMenu(MF_SEPARATOR);
  132.         pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
  133.     }
  134.  
  135.     // Set the icon for this dialog.  The framework does this automatically
  136.     //  when the application's main window is not a dialog
  137.     SetIcon(m_hIcon, TRUE);            // Set big icon
  138.     SetIcon(m_hIcon, FALSE);        // Set small icon
  139.     
  140.   // Fill the "Compression Level" combo box (not sorted!)
  141.   m_cbLevel.AddString( "No compression" );
  142.   m_cbLevel.AddString( "Low compression" );
  143.   m_cbLevel.AddString( "Medium compression" );
  144.   m_cbLevel.AddString( "Maximum compression" );
  145.   
  146.   m_cbLevel.SetItemData( 0, 0 /* xclNone */ );
  147.   m_cbLevel.SetItemData( 1, 1 /* xclLow */ );
  148.   m_cbLevel.SetItemData( 2, 6 /* xclMedium */ );
  149.   m_cbLevel.SetItemData( 3, 9 /* xclHigh */ );
  150.  
  151.   m_cbLevel.SetCurSel( 3 );
  152.  
  153.   // Set the status bar limits
  154.   m_prStatus.SetRange( 0, 100 );
  155.  
  156.   // We'll work with the Xceed Zip Control in background processing
  157.   m_xZip.SetBackgroundProcessing( TRUE );
  158.     
  159.     return TRUE;  // return TRUE  unless you set the focus to a control
  160. }
  161.  
  162. void CStartedDlg::OnSysCommand(UINT nID, LPARAM lParam)
  163. {
  164.     if ((nID & 0xFFF0) == IDM_ABOUTBOX)
  165.     {
  166.         CAboutDlg dlgAbout;
  167.         dlgAbout.DoModal();
  168.     }
  169.     else
  170.     {
  171.         CDialog::OnSysCommand(nID, lParam);
  172.     }
  173. }
  174.  
  175. // If you add a minimize button to your dialog, you will need the code below
  176. //  to draw the icon.  For MFC applications using the document/view model,
  177. //  this is automatically done for you by the framework.
  178.  
  179. void CStartedDlg::OnPaint() 
  180. {
  181.     if (IsIconic())
  182.     {
  183.         CPaintDC dc(this); // device context for painting
  184.  
  185.         SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
  186.  
  187.         // Center icon in client rectangle
  188.         int cxIcon = GetSystemMetrics(SM_CXICON);
  189.         int cyIcon = GetSystemMetrics(SM_CYICON);
  190.         CRect rect;
  191.         GetClientRect(&rect);
  192.         int x = (rect.Width() - cxIcon + 1) / 2;
  193.         int y = (rect.Height() - cyIcon + 1) / 2;
  194.  
  195.         // Draw the icon
  196.         dc.DrawIcon(x, y, m_hIcon);
  197.     }
  198.     else
  199.     {
  200.         CDialog::OnPaint();
  201.     }
  202. }
  203.  
  204. // The system calls this to obtain the cursor to display while the user drags
  205. //  the minimized window.
  206. HCURSOR CStartedDlg::OnQueryDragIcon()
  207. {
  208.     return (HCURSOR) m_hIcon;
  209. }
  210.  
  211. // We created this utility method to match a string with an Xceed Zip operation
  212. CString CStartedDlg::GetOperation( int nOperation )
  213. {
  214.   switch( nOperation )
  215.   {
  216.     case 0: /* xcoIdle */
  217.       return CString( "doing nothing" );
  218.  
  219.     case 1: /* xcoPreviewing */
  220.       return CString( "previewing" );
  221.  
  222.     case 2: /* xcoListing */
  223.       return CString( "listing" );
  224.  
  225.     case 3: /* xcoZipping */
  226.       return CString( "zipping" );
  227.  
  228.     case 4: /* xcoUnzipping */
  229.       return CString( "unzipping" );
  230.  
  231.     case 5: /* xcoRemoving */
  232.       return CString( "removing" );
  233.  
  234.     case 6: /* xcoTestingZipFile */
  235.       return CString( "testing" );
  236.  
  237.     case 7: /* xcoConverting */
  238.       return CString( "converting" );
  239.   }
  240.  
  241.   return CString();
  242. }
  243.  
  244. void CStartedDlg::OnQuit() 
  245. {
  246.   if( m_xZip.GetCurrentOperation() != 0 /* xcoIdle */ )
  247.   {
  248.     m_xZip.SetAbort( TRUE );
  249.   }
  250.   else
  251.   {
  252.     EndDialog( IDOK );
  253.   }
  254. }
  255.  
  256. void CStartedDlg::OnZip() 
  257. {
  258.     if( UpdateData( TRUE ) )
  259.   {
  260.     // First, set the general properties
  261.     m_xZip.SetZipFilename( m_sZipFilename );
  262.     m_xZip.SetFilesToProcess( m_sFilesToProcess );
  263.     m_xZip.SetFilesToExclude( m_sFilesToExclude );
  264.     m_xZip.SetProcessSubfolders( m_bSubfolders );
  265.     m_xZip.SetPreservePaths( m_bPreserve );
  266.  
  267.     // Then set the zipping specific properties
  268.     int nIndex  = m_cbLevel.GetCurSel();
  269.  
  270.     if( nIndex != CB_ERR )
  271.     {
  272.       m_xZip.SetCompressionLevel( m_cbLevel.GetItemData( nIndex ) );
  273.     }
  274.  
  275.     m_xZip.SetUseTempFile( m_bUseTemp );
  276.  
  277.     // Reset the list and status bar
  278.     if( m_xZip.GetCurrentOperation() == 0 /* xcoIdle */ )
  279.     {
  280.       m_lstResults.ResetContent();
  281.       m_prStatus.SetPos( 0 );
  282.     }
  283.     // Else, for the sake of the demonstration, we'll let the call to Zip
  284.     // go through even if the control is already doing something
  285.  
  286.     // Call the Zip method to start zipping
  287.     int nErr  = m_xZip.Zip();
  288.  
  289.     if( nErr == 1 /* xerProcessStarted */ )
  290.     {
  291.       SetDlgItemText( IDOK, "&Abort" );
  292.       GetDlgItem( IDOK )->UpdateWindow();
  293.     }
  294.     else
  295.     {
  296.       MessageBox( m_xZip.GetErrorDescription( 0 /* xvtError */, nErr ), 
  297.                   NULL, 
  298.                   MB_ICONSTOP | MB_OK );
  299.     }
  300.   }
  301. }
  302.  
  303. void CStartedDlg::OnUnzip() 
  304. {
  305.     if( UpdateData( TRUE ) )
  306.   {
  307.     // First, set the general properties
  308.     m_xZip.SetZipFilename( m_sZipFilename );
  309.     m_xZip.SetFilesToProcess( m_sFilesToProcess );
  310.     m_xZip.SetFilesToExclude( m_sFilesToExclude );
  311.     m_xZip.SetProcessSubfolders( m_bSubfolders );
  312.     m_xZip.SetPreservePaths( m_bPreserve );
  313.  
  314.     // Then set the unzipping specific properties
  315.     m_xZip.SetUnzipToFolder( m_sUnzipFolder );
  316.  
  317.     // Reset the list and status bar
  318.     if( m_xZip.GetCurrentOperation() == 0 /* xcoIdle */ )
  319.     {
  320.       m_lstResults.ResetContent();
  321.       m_prStatus.SetPos( 0 );
  322.     }
  323.     // Else, for the sake of the demonstration, we'll let the call to Unzip
  324.     // go through even if the control is already doing something
  325.  
  326.     // Call the Unzip method to start zipping
  327.     int nErr  = m_xZip.Unzip();
  328.  
  329.     if( nErr == 1 /* xerProcessStarted */ )
  330.     {
  331.       SetDlgItemText( IDOK, "&Abort" );
  332.       GetDlgItem( IDOK )->UpdateWindow();
  333.     }
  334.     else
  335.     {
  336.       MessageBox( m_xZip.GetErrorDescription( 0 /* xvtError */, nErr ), 
  337.                   NULL, 
  338.                   MB_ICONSTOP | MB_OK );
  339.     }
  340.   }
  341. }
  342.  
  343. void CStartedDlg::OnTest() 
  344. {
  345.     if( UpdateData( TRUE ) )
  346.   {
  347.     // First, set the general properties
  348.     m_xZip.SetZipFilename( m_sZipFilename );
  349.  
  350.     // When testing, file masks are not used
  351.  
  352.     // Reset the list and status bar
  353.     if( m_xZip.GetCurrentOperation() == 0 /* xcoIdle */ )
  354.     {
  355.       m_lstResults.ResetContent();
  356.       m_prStatus.SetPos( 0 );
  357.     }
  358.     // Else, for the sake of the demonstration, we'll let the call to 
  359.     // TestZipFile go through even if the control is already doing something
  360.  
  361.     // Call the TestZipFile method to start zipping
  362.     int nErr  = m_xZip.TestZipFile( TRUE );
  363.  
  364.     if( nErr == 1 /* xerProcessStarted */ )
  365.     {
  366.       SetDlgItemText( IDOK, "&Abort" );
  367.       GetDlgItem( IDOK )->UpdateWindow();
  368.     }
  369.     else
  370.     {
  371.       MessageBox( m_xZip.GetErrorDescription( 0 /* xvtError */, nErr ), 
  372.                   NULL, 
  373.                   MB_ICONSTOP | MB_OK );
  374.     }
  375.   }
  376. }
  377.  
  378. void CStartedDlg::OnList() 
  379. {
  380.     if( UpdateData( TRUE ) )
  381.   {
  382.     // First, set the general properties
  383.     m_xZip.SetZipFilename( m_sZipFilename );
  384.     m_xZip.SetFilesToProcess( m_sFilesToProcess );
  385.     m_xZip.SetFilesToExclude( m_sFilesToExclude );
  386.     m_xZip.SetProcessSubfolders( m_bSubfolders );
  387.     m_xZip.SetPreservePaths( m_bPreserve );
  388.  
  389.     // Reset the list and status bar
  390.     if( m_xZip.GetCurrentOperation() == 0 /* xcoIdle */ )
  391.     {
  392.       m_lstResults.ResetContent();
  393.       m_prStatus.SetPos( 0 );
  394.     }
  395.     // Else, for the sake of the demonstration, we'll let the call to 
  396.     // ListZipContents go through even if the control is already doing something
  397.  
  398.     // Call the ListZipContents method to start zipping
  399.     int nErr  = m_xZip.ListZipContents();
  400.  
  401.     if( nErr == 1 /* xerProcessStarted */ )
  402.     {
  403.       SetDlgItemText( IDOK, "&Abort" );
  404.       GetDlgItem( IDOK )->UpdateWindow();
  405.     }
  406.     else
  407.     {
  408.       MessageBox( m_xZip.GetErrorDescription( 0 /* xvtError */, nErr ), 
  409.                   NULL, 
  410.                   MB_ICONSTOP | MB_OK );
  411.     }
  412.   }
  413. }
  414.  
  415. void CStartedDlg::OnPreview() 
  416. {
  417.     if( UpdateData( TRUE ) )
  418.   {
  419.     // First, set the general properties
  420.     m_xZip.SetZipFilename( m_sZipFilename );
  421.     m_xZip.SetFilesToProcess( m_sFilesToProcess );
  422.     m_xZip.SetFilesToExclude( m_sFilesToExclude );
  423.     m_xZip.SetProcessSubfolders( m_bSubfolders );
  424.     m_xZip.SetPreservePaths( m_bPreserve );
  425.  
  426.     // Reset the list and status bar
  427.     if( m_xZip.GetCurrentOperation() == 0 /* xcoIdle */ )
  428.     {
  429.       m_lstResults.ResetContent();
  430.       m_prStatus.SetPos( 0 );
  431.     }
  432.     // Else, for the sake of the demonstration, we'll let the call to 
  433.     // PreviewFiles go through even if the control is already doing something
  434.  
  435.     // Call the PreviewFiles method to start zipping
  436.     int nErr  = m_xZip.PreviewFiles( FALSE );
  437.  
  438.     if( nErr != 1 /* xerProcessStarted */ )
  439.     {
  440.       MessageBox( m_xZip.GetErrorDescription( 0 /* xvtError */, nErr ), 
  441.                   NULL, 
  442.                   MB_ICONSTOP | MB_OK );
  443.     }
  444.   }
  445. }
  446.  
  447. BOOL CStartedDlg::DestroyWindow() 
  448. {
  449.     // Do not let this application quit if the Xceed Zip Control is busy
  450.   if( m_xZip.m_hWnd && m_xZip.GetCurrentOperation() != 0 /* xcoIdle */ )
  451.   {
  452.     return FALSE;
  453.   }
  454.  
  455.   return CDialog::DestroyWindow();
  456. }
  457.  
  458. BEGIN_EVENTSINK_MAP(CStartedDlg, CDialog)
  459.     //{{AFX_EVENTSINK_MAP(CStartedDlg)
  460.     ON_EVENT(CStartedDlg, IDC_Z_XCEED, 6001 /* ListingFile */, OnXceedZipListingFile, VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_I2 VTS_I4 VTS_I4 VTS_DATE VTS_DATE VTS_DATE VTS_I4 VTS_BOOL VTS_I4 VTS_BOOL VTS_I4)
  461.     ON_EVENT(CStartedDlg, IDC_Z_XCEED, 6000 /* PreviewingFile */, OnXceedZipPreviewingFile, VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_DATE VTS_DATE VTS_DATE VTS_BOOL VTS_I4)
  462.     ON_EVENT(CStartedDlg, IDC_Z_XCEED, 6102 /* SkippingFile */, OnXceedZipSkippingFile, VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_DATE VTS_DATE VTS_DATE VTS_I4 VTS_BOOL VTS_I4)
  463.     ON_EVENT(CStartedDlg, IDC_Z_XCEED, 6100 /* FileStatus */, OnXceedZipFileStatus, VTS_BSTR VTS_I4 VTS_I4 VTS_I4 VTS_I2 VTS_I2 VTS_BOOL)
  464.     ON_EVENT(CStartedDlg, IDC_Z_XCEED, 6101 /* GlobalStatus */, OnXceedZipGlobalStatus, VTS_I4 VTS_I4 VTS_I4 VTS_I2 VTS_I4 VTS_I4 VTS_I4 VTS_I2 VTS_I4 VTS_I2)
  465.     ON_EVENT(CStartedDlg, IDC_Z_XCEED, 8900 /* ProcessCompleted */, OnXceedZipProcessCompleted, VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I2 VTS_I4)
  466.     ON_EVENT(CStartedDlg, IDC_Z_XCEED, 6103 /* Warning */, OnXceedZipWarning, VTS_BSTR VTS_I4)
  467.     ON_EVENT(CStartedDlg, IDC_Z_XCEED, 6104 /* ZipContentsStatus */, OnXceedZipContentsStatus, VTS_I4 VTS_I4 VTS_I2)
  468.     //}}AFX_EVENTSINK_MAP
  469. END_EVENTSINK_MAP()
  470.  
  471. void CStartedDlg::OnXceedZipListingFile(LPCTSTR sFilename, LPCTSTR sComment, long lSize, long lCompressedSize, short nCompressionRatio, long xAttributes, long lCRC, DATE dtLastModified, DATE dtLastAccessed, DATE dtCreated, long xMethod, BOOL bEncrypted, long lDiskNumber, BOOL bExcluded, long xReason) 
  472. {
  473.   // A file in the zip is being listed
  474.   CString sLine;
  475.  
  476.   sLine.Format( "%s [%d kb]", sFilename, lSize/1024 );
  477.   m_lstResults.AddString( sLine );
  478. }
  479.  
  480. void CStartedDlg::OnXceedZipPreviewingFile(LPCTSTR sFilename, LPCTSTR sSourceFilename, long lSize, long xAttributes, DATE dtLastModified, DATE dtLastAccessed, DATE dtCreated, BOOL bExcluded, long xReason) 
  481. {
  482.   // A file on the disk is being scanned
  483.   CString sLine;
  484.  
  485.   sLine.Format( "%s [%d kb]", sFilename, lSize/1024 );
  486.   m_lstResults.AddString( sLine );
  487. }
  488.  
  489. void CStartedDlg::OnXceedZipSkippingFile(LPCTSTR sFilename, LPCTSTR sComment, LPCTSTR sFilenameOnDisk, long lSize, long lCompressedSize, long xAttributes, long lCRC, DATE dtLastModified, DATE dtLastAccessed, DATE dtCreated, long xMethod, BOOL bEncrypted, long xReason) 
  490. {
  491.     // A file is being skipped for a specific reason
  492.     CString sLine;
  493.  
  494.   sLine.Format( "File %s is skipped for reason %d", sFilename, xReason );
  495.   m_lstResults.AddString( sLine );
  496.   m_lstResults.AddString( m_xZip.GetErrorDescription( 2 /* xvtSkippingReason */, xReason ) );
  497. }
  498.  
  499. void CStartedDlg::OnXceedZipFileStatus(LPCTSTR sFilename, long lSize, long lCompressedSize, long lBytesProcessed, short nBytesPercent, short nCompressionRatio, BOOL bFileCompleted) 
  500. {
  501.   // ZipPreprocessingFile and UnzipPreprocessingFile occur for each file 
  502.   // before a single byte is actually processed. Thus, the FileStatus is
  503.   // the best place to display file info WHILE each file is processed.
  504.   if( lBytesProcessed == 0 )
  505.   {
  506.     // First time FileStatus is triggered for this file!
  507.     m_lstResults.AddString( GetOperation( m_xZip.GetCurrentOperation() ) + " " + sFilename );
  508.   }
  509. }
  510.  
  511. void CStartedDlg::OnXceedZipGlobalStatus(long lFilesTotal, long lFilesProcessed, long lFilesSkipped, short nFilesPercent, long lBytesTotal, long lBytesProcessed, long lBytesSkipped, short nBytesPercent, long lBytesOutput, short nCompressionRatio) 
  512. {
  513.     // More processing in general was done
  514.     m_prStatus.SetPos( nBytesPercent );
  515. }
  516.  
  517. void CStartedDlg::OnXceedZipProcessCompleted(long lFilesTotal, long lFilesProcessed, long lFilesSkipped, long lBytesTotal, long lBytesProcessed, long lBytesSkipped, long lBytesOutput, short nCompressionRatio, long xResult) 
  518. {
  519.     // The operation completed
  520.     m_lstResults.AddString( m_xZip.GetErrorDescription( 0 /* xvtError */, xResult ) );
  521.  
  522.   // Change the "Abort" button back to "Quit"
  523.   SetDlgItemText( IDOK, "&Quit" );
  524.   GetDlgItem( IDOK )->UpdateWindow();
  525. }
  526.  
  527. void CStartedDlg::OnXceedZipWarning(LPCTSTR sFilename, long xWarning) 
  528. {
  529.     // A warning occured. Processing of the file continues (as opposed to skipping)
  530.     CString sLine;
  531.  
  532.   sLine.Format( "Warning %d occured on file %s", xWarning, sFilename );
  533.   m_lstResults.AddString( sLine );
  534.   m_lstResults.AddString( m_xZip.GetErrorDescription( 1 /* xvtWarning */, xWarning ) );
  535. }
  536.  
  537. void CStartedDlg::OnXceedZipContentsStatus(long lFilesRead, long lFilesTotal, short nFilesPercent) 
  538. {
  539.   // This event is triggered while reading an existing zip file.
  540.   m_prStatus.SetPos( nFilesPercent );
  541. }
  542.