Exception.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:1k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /********************************************************************
  2. created: 2003/02/13
  3. file base: Exception
  4. file ext: h
  5. author: liupeng
  6. purpose: Header file for CException class
  7. *********************************************************************/
  8. #ifndef __INCLUDE_EXCEPTION_H__
  9. #define __INCLUDE_EXCEPTION_H__
  10. #if defined (_MSC_VER) && (_MSC_VER >= 1020)
  11. #pragma once
  12. #endif
  13. #pragma warning(disable: 4201)   // nameless struct/union
  14. #ifndef _WINDOWS_
  15. #define WIN32_LEAN_AND_MEAN
  16. #include <windows.h>
  17. #undef WIN32_LEAN_AND_MEAN
  18. #endif
  19. #include "tstring.h"
  20. #pragma warning(disable: 4201)
  21. /*
  22.  * namespace OnlineGameLib::Win32
  23.  */
  24. namespace OnlineGameLib {
  25. namespace Win32 {
  26. /*
  27.  * CException
  28.  */
  29. class CException
  30. {
  31. public:
  32. CException( const _tstring &where, const _tstring &message );
  33. virtual ~CException() {}
  34. virtual _tstring GetWhere() const;
  35. virtual _tstring GetMessage() const;
  36. void MessageBox( HWND hWnd = NULL ) const; 
  37. protected:
  38. const _tstring m_where;
  39. const _tstring m_message;
  40. };
  41. } // End of namespace OnlineGameLib
  42. } // End of namespace Win32
  43. #endif //__INCLUDE_EXCEPTION_H__