自定义异常处理
来源:互联网 发布:js 根据日期计算年龄 编辑:程序博客网 时间:2024/05/16 23:57
/************************************************************************/
/*
File: exception.h
Author: WLW
Data: 2006.4.24
Purpose: Exception deal
*/
/************************************************************************/
#pragma once
#include <Windows.h>
#include <string>
using namespace std;
class Exception
{
public:
Exception(void){ strError = "Unknown Exception!/r/n"; }
Exception(const Exception &e) { strError = e.strError; }
Exception(const char *pcszError){ strError = pcszError; }
~Exception(void) {}
void ThrowException(void) const { OutputDebugString(strError.c_str()); }
void ThrowException(const char *pcszError) const { OutputDebugString(pcszError); }
const string Description(void) const { return strError; }
private:
string strError;
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int _tmain(int argc, _TCHAR* argv[])
{
try
{
int i = 3;
if (i < 4)
{
throw Exception("less number/r/n");
}
}
catch (Exception e)
{
e.ThrowException();
return 0;
}
return 1;
}
- 异常处理+异常+处理异常+自定义异常
- Java异常处理-----自定义异常
- Java异常处理--自定义异常
- VB自定义异常处理
- 自定义异常处理
- 自定义异常处理
- PHP自定义异常处理
- 自定义异常处理
- 自定义异常处理类
- 自定义异常处理
- 自定义异常处理过滤器
- 自定义异常处理错误信息
- set_exception_handler 自定义异常处理
- C#自定义异常处理
- 自定义C++异常处理
- 自定义C++异常处理
- 自定义异常处理机制
- C#自定义异常处理
- 面象对象设计的原则
- 由Ajax大赛想到的--老谢的博客开通了
- VC下打印机的使用
- 张忠谋讲义摘要
- ADO访问数据库大全
- 自定义异常处理
- 手机斜角地图中A*算法的实用化
- 用 Eclipse 和 Ant 进行 Python 开发
- 在Weblogic Portal里加入Struts的应用程序主要步骤
- 弹出窗体
- The Process of Software Architecting
- 从弹出窗体的操作引发父窗体的刷新
- js如何在IE中动态用xsl来解析xml
- CSDN 技术中心新版本公测喽!