RLib  5.7
RLib - an opensource, lightweight and multi-platform framework for cpp programming
System::Exception Class Reference

表示标准异常类 More...

Public Member Functions

 Exception ()
 初始化 Exception 类的新实例 More...
 
 Exception (const TCHAR *lpmsg, INT id=-1)
 使用指定的错误编号和错误消息初始化 Exception 类的新实例 More...
 
void Set (INT HResult, const TCHAR *Message)
 设置异常信息 More...
 
void SetDebugInfo (const TCHAR *, const TCHAR *)
 
void Ref (const class Exception &)
 引用异常类 More...
 

Static Public Member Functions

static DWORD GetLastErrorId ()
 获取最近一次错误编号 More...
 
static bool FormatErrorMessage (OUT LPTSTR lptstr, DWORD nchar, IN DWORD err_code)
 Formats a message string, the caller can ask the function to search the system's message table resource(s) for the message definition More...
 
static bool FormatException (OUT Exception *lpex, IN DWORD err_code)
 获取文本错误信息 More...
 
static ExceptionGetLastException ()
 获取最近一次的异常对象 More...
 
static ExceptionGetLastException (DWORD err_code)
 获取最近一次的异常对象, 并指定 HResult 属性 More...
 
static void SetLastErrorId (DWORD err_code)
 设置最近一次发生的错误 More...
 
static void SetLastException (NTSTATUS status, bool bAlertInDebug=true)
 Sets the last exception from NTSTATUS More...
 

Public Attributes

union {
   INT   HResult
 
   DWORD   ErrorNo
 
}; 
 获取或设置 HRESULT,它是分配给特定异常的编码数值 More...
 
TCHAR Message [RLIB_EXCEPTION_MSG_LENGTH]
 获取描述当前异常的消息 More...
 
 RLIB_DECLARE_DYNCREATE
 

Detailed Description

表示标准异常类

Constructor & Destructor Documentation

Exception::Exception ( )

初始化 Exception 类的新实例

System::Exception::Exception ( const TCHAR *  lpmsg,
INT  id = -1 
)

使用指定的错误编号和错误消息初始化 Exception 类的新实例

Member Function Documentation

bool Exception::FormatErrorMessage ( OUT LPTSTR  lptstr,
DWORD  nchar,
IN DWORD  err_code 
)
static

Formats a message string, the caller can ask the function to search the system's message table resource(s) for the message definition

Parameters
lptstrA pointer to a buffer that receives the null-terminated string that specifies the formatted message
ncharSpecifies the size of the output buffer, in TCHARs, with null-terminator
err_codeOptional custom error code
bool Exception::FormatException ( OUT Exception lpex,
IN DWORD  err_code 
)
static

获取文本错误信息

DWORD Exception::GetLastErrorId ( )
static

获取最近一次错误编号

Exception * Exception::GetLastException ( )
static

获取最近一次的异常对象

Exception * Exception::GetLastException ( DWORD  err_code)
static

获取最近一次的异常对象, 并指定 HResult 属性

void Exception::Ref ( const class Exception )

引用异常类

void Exception::Set ( INT  HResult,
const TCHAR *  Message 
)

设置异常信息

void Exception::SetLastErrorId ( DWORD  err_code)
static

设置最近一次发生的错误

void Exception::SetLastException ( NTSTATUS  status,
bool  bAlertInDebug = true 
)
static

Sets the last exception from NTSTATUS

Member Data Documentation

union { ... }

获取或设置 HRESULT,它是分配给特定异常的编码数值

TCHAR System::Exception::Message[RLIB_EXCEPTION_MSG_LENGTH]

获取描述当前异常的消息


The documentation for this class was generated from the following files: