Index: src/ch/ExceptionEx.h =================================================================== diff -u -N --- src/ch/ExceptionEx.h (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/ExceptionEx.h (revision 0) @@ -1,219 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2001-2008 by J�zef Starosczyk * -* ixen@copyhandler.com * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU Library General Public License * -* (version 2) as published by the Free Software Foundation; * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU Library General Public * -* License along with this program; if not, write to the * -* Free Software Foundation, Inc., * -* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * -***************************************************************************/ -/************************************************************************* - File: Exception.h - Version: 1.0 - Author: Ixen Gerthannes (ixen@interia.pl) - File description: - Contain CException class - a base for any other exception - types. - Classes: - CException - - provides basic exception functionality. - - when used with MFC class name is CExceptionEx (it's - not based on MFC CException!). -*************************************************************************/ -#ifndef __EXCEPTION_H__ -#define __EXCEPTION_H__ - -#include "stdio.h" - -#define THROW_EXCEPTIONEX(str_reason, app_code, last_error) throw new CExceptionEx(__FILE__, __LINE__, __FUNCTION__, str_reason, app_code, last_error) - -// not too specific - use specialised classes based on this one (this also could be used) -class CExceptionEx -{ -protected: - enum PropType { dtString, dtPtrToString, dtDword, dtSysError }; - - struct __EXCPROPINFO - { - TCHAR szName[64]; // name of the property (ie."Source file") - PropType eType; // type of the property (string, dword, bool, ...) - void* pData; // pointer to the value of the property - }; - -public: - CExceptionEx(PCTSTR pszSrcFile, DWORD dwLine, PCTSTR pszFunc, PCTSTR pszReason, DWORD dwReason, DWORD dwLastError=0) - { - // init the object with a given values - _tcsncpy(m_szSourceFile, pszSrcFile, _MAX_PATH); - m_szSourceFile[_MAX_PATH-1]=_T('\0'); - m_dwSourceLine=dwLine; - _tcsncpy(m_szFunction, pszFunc, _MAX_PATH); - m_szFunction[_MAX_PATH-1]=_T('\0'); - SetReason(pszReason); - m_dwReason=dwReason; - m_dwError=dwLastError; - }; - CExceptionEx(PCTSTR pszSrcFile, DWORD dwLine, PCTSTR pszFunc, TCHAR* pszReason, DWORD dwReason, DWORD dwLastError=0) - { - _tcsncpy(m_szSourceFile, pszSrcFile, _MAX_PATH); - m_szSourceFile[_MAX_PATH-1]=_T('\0'); - m_dwSourceLine=dwLine; - _tcsncpy(m_szFunction, pszFunc, _MAX_PATH); - m_szFunction[_MAX_PATH-1]=_T('\0'); - m_pszReason=pszReason; - m_dwReason=dwReason; - m_dwError=dwLastError; - }; - - virtual ~CExceptionEx() { delete [] m_pszReason; }; - - virtual int RegisterInfo(__EXCPROPINFO* pInfo) - { - // if the pInfo is null - return count of a needed props - if (pInfo == NULL) - return 6; // +baseClass::RegisterInfo - - // call base class RegisterInfo - - // function has to register the info to be displayed (called from within GetInfo) - RegisterProp(pInfo+0, _T("Source file"), dtString, &m_szSourceFile); - RegisterProp(pInfo+1, _T("Line"), dtDword, &m_dwSourceLine); - RegisterProp(pInfo+2, _T("Function"), dtString, &m_szFunction); - RegisterProp(pInfo+3, _T("Reason"), dtPtrToString, &m_pszReason); - RegisterProp(pInfo+4, _T("App error"), dtDword, &m_dwReason); - RegisterProp(pInfo+5, _T("System error"), dtSysError, &m_dwError); - - return 6; - }; - -public: - // helpers - static TCHAR* FormatReason(PCTSTR pszReason, ...) - { - const size_t stMaxReason = 1024; - TCHAR szBuf[stMaxReason]; - - va_list marker; - va_start(marker, pszReason); - _vsntprintf(szBuf, stMaxReason - 1, pszReason, marker); - szBuf[stMaxReason - 1] = _T('\0'); - va_end(marker); - - TCHAR *pszData=new TCHAR[_tcslen(szBuf)+1]; - _tcscpy(pszData, szBuf); - return pszData; - }; - - // formats max info about this exception - virtual TCHAR* GetInfo(LPCTSTR pszDesc, TCHAR* pszStr, DWORD dwMaxLen) - { - const size_t stMaxData = 1024; - - // get the properties - int iCount=RegisterInfo(NULL); - __EXCPROPINFO *pepi=new __EXCPROPINFO[iCount]; - RegisterInfo(pepi); // register all the properties - - // add the desc to the out - if (pszDesc) - { - _tcsncpy(pszStr, pszDesc, dwMaxLen-1); - pszStr[dwMaxLen-1]=_T('\0'); - } - else - pszStr[0]=_T('\0'); - - size_t tIndex=_tcslen(pszStr); - - // format the info accordingly - TCHAR szData[stMaxData]; - for (int i=0;iszName, pszName, 63); - pInfo->szName[63]=_T('\0'); - pInfo->eType=type; - pInfo->pData=pData; - }; - -public: - // exception information - TCHAR m_szSourceFile[_MAX_PATH]; // source file from where the exception is being thrown - DWORD m_dwSourceLine; // line in the source file from where exception has been thrown - TCHAR m_szFunction[_MAX_PATH]; // name of the function in which the exception occured - TCHAR *m_pszReason; // description of this error (in english - internal error code - description - human readable) - DWORD m_dwReason; // numerical value that states app-level error number - DWORD m_dwError; // in most cases GetLastError() when it has any sense -}; - -#endif \ No newline at end of file Index: src/ch/ch.rc =================================================================== diff -u -N -r4eb85a155fa392c210354f5e0c62ae40fcb17ef2 -r9248b74686de6c2b986a17914c3f22b3f060ac50 --- src/ch/ch.rc (.../ch.rc) (revision 4eb85a155fa392c210354f5e0c62ae40fcb17ef2) +++ src/ch/ch.rc (.../ch.rc) (revision 9248b74686de6c2b986a17914c3f22b3f060ac50) @@ -482,10 +482,10 @@ PUSHBUTTON "&Skip",IDC_SKIP_BUTTON,111,124,50,14 PUSHBUTTON "&Pause",IDC_PAUSE_BUTTON,163,124,50,14 PUSHBUTTON "&Cancel",IDC_CANCEL_BUTTON,215,124,50,14 - ICON "",IDC_SRC_ICON_STATIC,21,36,21,20 - ICON "",IDC_DST_ICON_STATIC,21,86,21,20 - LTEXT "File: c:\\projects\\xxx.avi\nSize: 154kB\nLast modified: 2008-01-12",IDC_SRC_INFO_STATIC,59,32,206,36 - LTEXT "File: c:\\projects\\xxx.avi\nSize: 154kB\nLast modified: 2008-01-12",IDC_DST_INFO_STATIC,59,81,206,36 + ICON "",IDC_SRC_ICON_STATIC,21,36,20,20 + ICON "",IDC_DST_ICON_STATIC,21,86,20,20 + LTEXT "",IDC_SRC_INFO_STATIC,59,32,206,36 + LTEXT "",IDC_DST_INFO_STATIC,59,81,206,36 LTEXT "File being copied:",IDC_00_STATIC,14,19,250,8 LTEXT "Existing file:",IDC_01_STATIC,15,69,250,8 END @@ -630,24 +630,6 @@ #endif // APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Toolbar -// - -IDR_POPUP_TOOLBAR TOOLBAR 16, 15 -BEGIN - BUTTON ID_POPUP_OPTIONS -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDR_POPUP_TOOLBAR BITMAP "res\\main_toolbar.bmp" - #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // Index: src/ch/ch.vc90.vcproj =================================================================== diff -u -N -r83c2261d1834199e9a9b453b03689532f4ec1188 -r9248b74686de6c2b986a17914c3f22b3f060ac50 --- src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision 83c2261d1834199e9a9b453b03689532f4ec1188) +++ src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision 9248b74686de6c2b986a17914c3f22b3f060ac50) @@ -398,25 +398,466 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -510,371 +951,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +