runtimeexception.h

来自「串口通信mfc源码」· C头文件 代码 · 共 41 行

H
41
字号
// ***************************************************************
//  RuntimeException   version:  1.0   ·  date: 06/30/2006
//  -------------------------------------------------------------
//  
//  -------------------------------------------------------------
//  Copyright (C) 2001-2006 - Midapexsoft All Rights Reserved
// ***************************************************************
// 
// ***************************************************************
#pragma once
#include "afx.h"

class CRuntimeException :
	public CException
{
public:
	CRuntimeException(DWORD dwError);
	CRuntimeException(LPCTSTR lpszErrorMessage);

	//Methods
#ifdef _DEBUG
	virtual void Dump(CDumpContext& dc) const;
#endif
	virtual BOOL GetErrorMessage(LPTSTR lpstrError, UINT nMaxError,	PUINT pnHelpContext = NULL);
	CString GetErrorMessage();
	
	DWORD GetErrorCode() const;

protected:
	DECLARE_DYNAMIC(CRuntimeException)

	//Data members
	DWORD m_dwError;
	LPCTSTR m_lpszErrorMessage;
};

#define THROW_EX_CODE(error) throw new CRuntimeException(error);
#define THROW_EX(errorMessage) throw new CRuntimeException(errorMessage);


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?