Filter Library | Camera | Interface Physics |
Functions | |
void | SetModule (LPCTSTR szModuleName) |
This function allows setting the module name for additional logging options. | |
bool | tryEnable (void) |
Try to enable the error log. | |
bool | tryDisable (void) |
Try to disable the error log. | |
void | OutputDebugStringEx (LPCTSTR szFilename, const int iLine, LPCTSTR szExpression, LPCTSTR szErrorMessage, const LPDWORD pdwLastError=NULL) |
Reports about critical errors. | |
HRESULT | qafReportComError (const HRESULT hrStatus, LPCTSTR szFile, const int iLine) |
Reports about critical errors if HRESULT is failed. | |
DWORD | ReportWinError (const DWORD dwError, LPCTSTR szFile, const int iLine) |
Reports about critical errors if dwError != ERROR_SUCCESS. | |
DWORD | GetLogDir (LPTSTR lpszDirBuf, const DWORD dwMaxLen) |
Return an accessible directory name for all log files. | |
HRESULT | ReportComError (const HRESULT hrStatus, LPCTSTR szFile, const int iLine) |
Reports about critical errors if HRESULT is failed. | |
bool | ReportCheckError (const unsigned long ulConstExpr, const unsigned long ulCheckExpr, LPCTSTR szExpr, LPCTSTR szFile, const int iLine) |
Reports about critical errors if ulConstExpr != ulCheckExpr. |
DWORD QAFDebug::GetLogDir | ( | LPTSTR | lpszDirBuf, | |
const DWORD | dwMaxLen | |||
) |
lpszDirBuf | LPTSTR buffer for the directory name | |
dwMaxLen | DWORD size of the buffer in characters (including the trailing zero) |
1. Try get the folder path from the environment variable QAFDEBUG_LOG_ENV_VAR
2. Try CSIDL_APPDATA (C: and Settings Data) + QAFDEBUG_LOG_SUBFOLDER
3. Try CSIDL_COMMON_APPDATA (C: and Settings Users Data) + QAFDEBUG_LOG_SUBFOLDER
4. Return 0
If the folders are missing on the disk, they are created.
Definition at line 949 of file QAFDebug.cpp.
References CreateSubFolders0(), CSIDL_COMMON_APPDATA, CSIDL_FLAG_CREATE, Q_SHGFP_TYPE_CURRENT, QAFDEBUG_LOG_ENV_VAR, QAFDEBUG_LOG_SUBFOLDER, and SHGetSpecialFolderPathCustom().
Referenced by CQAFDebug::qafGetLogFileName().
void QAFDebug::OutputDebugStringEx | ( | LPCTSTR | szFilename, | |
const int | iLine, | |||
LPCTSTR | szExpression, | |||
LPCTSTR | szErrorMessage, | |||
const LPDWORD | pdwLastError = NULL | |||
) |
szFilename | LPCTSTR - the file name returned by _FILE_ | |
iLine | const int - the line number returned by _LINE_ | |
szExpression | LPCTSTR - the expression where the error was detected | |
szErrorMessage | LPCTSTR - the error message generated | |
pdwLastError | LPDWORD - the last error code must be restored |
Definition at line 731 of file QAFDebug.cpp.
References CQAFDebug::GetApplication(), CPreserveLastError::GetSavedLastError(), CQAFDebug::isEnabled(), isRN(), MAX_BUF_SIZE, ODS(), QAFDEBUG_ERROR_ALLOCATE_BUFFER, QAFDEBUG_ERROR_FORMAT, QAFDEBUG_STD_FORMAT, and CQAFDebug::tryOpenLogFile().
Referenced by qafReportComError(), ReportCheckError(), and ReportWinError().
HRESULT QAFDebug::qafReportComError | ( | const HRESULT | hrStatus, | |
LPCTSTR | szFile, | |||
const int | iLine | |||
) |
hrStatus | HRESULT - tested on failure | |
szFile | LPCTSTR - the file name returned by _FILE_ | |
iLine | const int - the line number returned by _LINE_ |
Definition at line 896 of file QAFDebug.cpp.
References OutputDebugStringEx(), QAFDEBUG_ERROR_NO_MESSAGE, QAFDEBUG_FMT_HRESULT, and QAFDEBUG_FMT_HRESULT_LEN.
Referenced by ReportComError().
bool QAFDebug::ReportCheckError | ( | const unsigned long | ulConstExpr, | |
const unsigned long | ulCheckExpr, | |||
LPCTSTR | szExpr, | |||
LPCTSTR | szFile, | |||
const int | iLine | |||
) | [inline] |
ulConstExpr | unsigned long - the expected expression | |
ulCheckExpr | unsigned long - the returned expression | |
szExpr | LPCTSTR - the expression of ulCheckExpr | |
szFile | LPCTSTR - the file name returned by _FILE_ | |
iLine | const int - the line number returned by _LINE_ |
Definition at line 891 of file QAFDebug.h.
References OutputDebugStringEx().
HRESULT QAFDebug::ReportComError | ( | const HRESULT | hrStatus, | |
LPCTSTR | szFile, | |||
const int | iLine | |||
) | [inline] |
hrStatus | HRESULT - tested on failure | |
szFile | LPCTSTR - the file name returned by _FILE_ | |
iLine | const int - the line number returned by _LINE_ |
Definition at line 870 of file QAFDebug.h.
References qafReportComError().
DWORD QAFDebug::ReportWinError | ( | const DWORD | dwError, | |
LPCTSTR | szFile, | |||
const int | iLine | |||
) |
dwError | DWORD - tested on failure | |
szFile | LPCTSTR - the file name returned by _FILE_ | |
iLine | const int - the line number returned by _LINE_ |
Definition at line 924 of file QAFDebug.cpp.
References OutputDebugStringEx(), QAFDEBUG_ERROR_NO_MESSAGE, QAFDEBUG_FMT_ERROR_SUCCESS, and QAFDEBUG_FMT_ERROR_SUCCESS_LEN.
void QAFDebug::SetModule | ( | LPCTSTR | szModuleName | ) |
LPCTSTR,name | of the DLL or EXE, 0-terminated, not longer than MAX_PATH characters. |
Definition at line 700 of file QAFDebug.cpp.
References CQAFDebug::SetLogModule().
bool QAFDebug::tryDisable | ( | void | ) |
Definition at line 717 of file QAFDebug.cpp.
References CQAFDebug::tryDisable().
bool QAFDebug::tryEnable | ( | void | ) |
Definition at line 712 of file QAFDebug.cpp.
References CQAFDebug::tryEnable().