Exception.cpp
Upload User: sbftbdw
Upload Date: 2007-01-03
Package Size: 379k
Code Size: 2k
Category:

Remote Control

Development Platform:

Visual C++

  1. //  Copyright (C) 1997, 1998 Olivetti & Oracle Research Laboratory
  2. //
  3. //  This file is part of the VNC system.
  4. //
  5. //  The VNC system is free software; you can redistribute it and/or modify
  6. //  it under the terms of the GNU General Public License as published by
  7. //  the Free Software Foundation; either version 2 of the License, or
  8. //  (at your option) any later version.
  9. //
  10. //  This program is distributed in the hope that it will be useful,
  11. //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. //  GNU General Public License for more details.
  14. //
  15. //  You should have received a copy of the GNU General Public License
  16. //  along with this program; if not, write to the Free Software
  17. //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
  18. //  USA.
  19. //
  20. // If the source code for the VNC system is not available from the place 
  21. // whence you received this file, check http://www.orl.co.uk/vnc or contact
  22. // the authors on vnc@orl.co.uk for information on obtaining it.
  23. #include "stdhdrs.h"
  24. #include "Exception.h"
  25. Exception::Exception(const char *info)
  26. {
  27. assert(info != NULL);
  28. m_info = new char[strlen(info)+1];
  29. strcpy(m_info, info);
  30. }
  31. Exception::~Exception()
  32. {
  33. delete [] m_info;
  34. }
  35. void Exception::Report()
  36. {
  37. assert(false);
  38. }
  39. // ---------------------------------------
  40. QuietException::QuietException(const char *info) : Exception(info)
  41. {
  42. }
  43. QuietException::~QuietException()
  44. {
  45. }
  46. void QuietException::Report()
  47. {
  48. _RPT1(_CRT_WARN, "Warning : %sn", m_info);
  49. }
  50. // ---------------------------------------
  51. WarningException::WarningException(const char *info, bool close) : Exception(info)
  52. {
  53. m_close = close;
  54. }
  55. WarningException::~WarningException()
  56. {
  57. }
  58. void WarningException::Report()
  59. {
  60. _RPT1(_CRT_WARN, "Warning : %sn", m_info);
  61. MessageBox(NULL, m_info, "VNC info", MB_OK| MB_ICONEXCLAMATION | MB_SETFOREGROUND | MB_TOPMOST);
  62. }
  63. // ---------------------------------------
  64. ErrorException::ErrorException(const char *info) : Exception(info)
  65. {
  66. }
  67. ErrorException::~ErrorException()
  68. {
  69. }
  70. void ErrorException::Report()
  71. {
  72. _RPT1(_CRT_WARN, "Warning : %sn", m_info);
  73. MessageBox(NULL, m_info, "VNC info", MB_OK | MB_ICONSTOP | MB_SETFOREGROUND | MB_TOPMOST);
  74. }