Use the new wxSysErrorMsgStr() instead of wxSysErrorMsg()
This commit is contained in:
@@ -1479,13 +1479,13 @@ wxSafeShowMessage(const wxString& title, const wxString& text);
|
|||||||
#define wxLogApiError(api, rc) \
|
#define wxLogApiError(api, rc) \
|
||||||
wxLogDebug(wxT("%s(%d): '%s' failed with error 0x%08lx (%s)."), \
|
wxLogDebug(wxT("%s(%d): '%s' failed with error 0x%08lx (%s)."), \
|
||||||
__FILE__, __LINE__, api, \
|
__FILE__, __LINE__, api, \
|
||||||
(long)rc, wxSysErrorMsg(rc))
|
(long)rc, wxSysErrorMsgStr(rc))
|
||||||
#else // !VC++
|
#else // !VC++
|
||||||
#define wxLogApiError(api, rc) \
|
#define wxLogApiError(api, rc) \
|
||||||
wxLogDebug(wxT("In file %s at line %d: '%s' failed with ") \
|
wxLogDebug(wxT("In file %s at line %d: '%s' failed with ") \
|
||||||
wxT("error 0x%08lx (%s)."), \
|
wxT("error 0x%08lx (%s)."), \
|
||||||
__FILE__, __LINE__, api, \
|
__FILE__, __LINE__, api, \
|
||||||
(long)rc, wxSysErrorMsg(rc))
|
(long)rc, wxSysErrorMsgStr(rc))
|
||||||
#endif // VC++/!VC++
|
#endif // VC++/!VC++
|
||||||
|
|
||||||
#define wxLogLastError(api) wxLogApiError(api, wxSysErrorCode())
|
#define wxLogLastError(api) wxLogApiError(api, wxSysErrorCode())
|
||||||
|
@@ -418,7 +418,7 @@ wxLog::CallDoLogNow(wxLogLevel level,
|
|||||||
{
|
{
|
||||||
const long err = static_cast<long>(num);
|
const long err = static_cast<long>(num);
|
||||||
|
|
||||||
suffix.Printf(_(" (error %ld: %s)"), err, wxSysErrorMsg(err));
|
suffix.Printf(_(" (error %ld: %s)"), err, wxSysErrorMsgStr(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_LOG_TRACE
|
#if wxUSE_LOG_TRACE
|
||||||
|
@@ -2411,7 +2411,7 @@ wxMBConv_iconv::ToWChar(wchar_t *dst, size_t dstLen,
|
|||||||
if (ICONV_FAILED(cres, srcLen))
|
if (ICONV_FAILED(cres, srcLen))
|
||||||
{
|
{
|
||||||
//VS: it is ok if iconv fails, hence trace only
|
//VS: it is ok if iconv fails, hence trace only
|
||||||
wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
|
wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsgStr(wxSysErrorCode()));
|
||||||
return wxCONV_FAILED;
|
return wxCONV_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2479,7 +2479,7 @@ size_t wxMBConv_iconv::FromWChar(char *dst, size_t dstLen,
|
|||||||
|
|
||||||
if (ICONV_FAILED(cres, inbuflen))
|
if (ICONV_FAILED(cres, inbuflen))
|
||||||
{
|
{
|
||||||
wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
|
wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsgStr(wxSysErrorCode()));
|
||||||
return wxCONV_FAILED;
|
return wxCONV_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -212,7 +212,7 @@ const wxString& wxDbgHelpDLL::GetErrorMessage()
|
|||||||
void wxDbgHelpDLL::LogError(const wxChar *func)
|
void wxDbgHelpDLL::LogError(const wxChar *func)
|
||||||
{
|
{
|
||||||
::OutputDebugString(wxString::Format(wxT("dbghelp: %s() failed: %s\r\n"),
|
::OutputDebugString(wxString::Format(wxT("dbghelp: %s() failed: %s\r\n"),
|
||||||
func, wxSysErrorMsg(::GetLastError())).t_str());
|
func, wxSysErrorMsgStr(::GetLastError())).t_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -470,7 +470,7 @@ wxString wxDialUpManagerMSW::GetErrorString(DWORD error)
|
|||||||
{
|
{
|
||||||
case ERROR_INVALID_PARAMETER:
|
case ERROR_INVALID_PARAMETER:
|
||||||
// this was a standard Win32 error probably
|
// this was a standard Win32 error probably
|
||||||
return wxString(wxSysErrorMsg(error));
|
return wxSysErrorMsgStr(error);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
@@ -1258,7 +1258,7 @@ static DWORD wxRasMonitorThread(wxRasThreadData *data)
|
|||||||
(
|
(
|
||||||
wxT("WaitForMultipleObjects(RasMonitor) failed: 0x%08lx (%s)"),
|
wxT("WaitForMultipleObjects(RasMonitor) failed: 0x%08lx (%s)"),
|
||||||
err,
|
err,
|
||||||
wxSysErrorMsg(err)
|
wxSysErrorMsgStr(err)
|
||||||
);
|
);
|
||||||
|
|
||||||
// no sense in continuing, who knows if the handles we're
|
// no sense in continuing, who knows if the handles we're
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include "wx/secretstore.h"
|
#include "wx/secretstore.h"
|
||||||
#include "wx/private/secretstore.h"
|
#include "wx/private/secretstore.h"
|
||||||
|
|
||||||
#include "wx/log.h" // wxSysErrorMsg()
|
#include "wx/log.h" // wxSysErrorMsgStr()
|
||||||
|
|
||||||
// Somewhat surprisingly, wincred.h is not self-contained and relies on some
|
// Somewhat surprisingly, wincred.h is not self-contained and relies on some
|
||||||
// standard Windows macros being defined without including the headers defining
|
// standard Windows macros being defined without including the headers defining
|
||||||
@@ -84,7 +84,7 @@ public:
|
|||||||
|
|
||||||
if ( !::CredWrite(&cred, 0) )
|
if ( !::CredWrite(&cred, 0) )
|
||||||
{
|
{
|
||||||
errmsg = wxSysErrorMsg();
|
errmsg = wxSysErrorMsgStr();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ public:
|
|||||||
// Not having the password for this service/user combination is not
|
// Not having the password for this service/user combination is not
|
||||||
// an error, but anything else is.
|
// an error, but anything else is.
|
||||||
if ( ::GetLastError() != ERROR_NOT_FOUND )
|
if ( ::GetLastError() != ERROR_NOT_FOUND )
|
||||||
errmsg = wxSysErrorMsg();
|
errmsg = wxSysErrorMsgStr();
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public:
|
|||||||
{
|
{
|
||||||
// Same logic as in Load() above.
|
// Same logic as in Load() above.
|
||||||
if ( ::GetLastError() != ERROR_NOT_FOUND )
|
if ( ::GetLastError() != ERROR_NOT_FOUND )
|
||||||
errmsg = wxSysErrorMsg();
|
errmsg = wxSysErrorMsgStr();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -1371,7 +1371,7 @@ void WXDLLIMPEXP_BASE wxWakeUpMainThread()
|
|||||||
wxS("Failed to wake up main thread: PostThreadMessage(WM_NULL) ")
|
wxS("Failed to wake up main thread: PostThreadMessage(WM_NULL) ")
|
||||||
wxS("failed with error 0x%08lx (%s)."),
|
wxS("failed with error 0x%08lx (%s)."),
|
||||||
ec,
|
ec,
|
||||||
wxSysErrorMsg(ec)
|
wxSysErrorMsgStr(ec)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user