Index: src/libchcore/TCoreException.cpp =================================================================== diff -u -N -r5fd6beaad9f1eccb664b997d151acb59961e4827 -rab32897e61cc637a1e28d9dc3f0489b8d16a429c --- src/libchcore/TCoreException.cpp (.../TCoreException.cpp) (revision 5fd6beaad9f1eccb664b997d151acb59961e4827) +++ src/libchcore/TCoreException.cpp (.../TCoreException.cpp) (revision ab32897e61cc637a1e28d9dc3f0489b8d16a429c) @@ -60,10 +60,49 @@ { } +// ============================================================================ +/// chcore::TCoreException::GetErrorInfo +/// @date 2011/07/18 +/// +/// @brief Retrieves formatted exception information. +/// @param[in] pszBuffer - buffer for formatted string +/// @param[in] stMaxBuffer - max size of buffer +// ============================================================================ void TCoreException::GetErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const { _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("Error code: %ld\r\nFile: %s\r\nFunction: %s\r\nLine no: %lu"), m_eErrorCode, m_pszFile, m_pszFunction, m_stLineNumber); pszBuffer[stMaxBuffer - 1] = _T('\0'); } +// ============================================================================ +/// chcore::TCoreWin32Exception::TCoreWin32Exception +/// @date 2011/07/18 +/// +/// @brief Constructs core win32 exception. +/// @param[in] eErrorCode - core error code +/// @param[in] dwWin32Exception - win32 error code +/// @param[in] pszFile -source file where the exception was thrown +/// @param[in] stLineNumber - source code line number where the exception was thrown +/// @param[in] pszFunction - function throwing the exception +// ============================================================================ +TCoreWin32Exception::TCoreWin32Exception(EGeneralErrors eErrorCode, DWORD dwWin32Exception, const tchar_t* pszFile, size_t stLineNumber, const tchar_t* pszFunction) : + TCoreException(eErrorCode, pszFile, stLineNumber, pszFunction), + m_dwWin32ErrorCode(dwWin32Exception) +{ +} + +// ============================================================================ +/// chcore::TCoreWin32Exception::GetErrorInfo +/// @date 2011/07/18 +/// +/// @brief Retrieves formatted exception information. +/// @param[in] pszBuffer - buffer for formatted string +/// @param[in] stMaxBuffer - max size of buffer +// ============================================================================ +void TCoreWin32Exception::GetErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const +{ + _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("Error code: %ld\r\nWin32 error code: %lu\r\nFile: %s\r\nFunction: %s\r\nLine no: %lu"), m_eErrorCode, m_dwWin32ErrorCode, m_pszFile, m_pszFunction, m_stLineNumber); + pszBuffer[stMaxBuffer - 1] = _T('\0'); +} + END_CHCORE_NAMESPACE