Use the new wxSysErrorMsgStr() instead of wxSysErrorMsg()

This commit is contained in:
Lauri Nurmi
2016-11-21 18:37:25 +02:00
parent 343318d73e
commit 902130f64e
7 changed files with 13 additions and 13 deletions

View File

@@ -1479,13 +1479,13 @@ wxSafeShowMessage(const wxString& title, const wxString& text);
#define wxLogApiError(api, rc) \
wxLogDebug(wxT("%s(%d): '%s' failed with error 0x%08lx (%s)."), \
__FILE__, __LINE__, api, \
(long)rc, wxSysErrorMsg(rc))
(long)rc, wxSysErrorMsgStr(rc))
#else // !VC++
#define wxLogApiError(api, rc) \
wxLogDebug(wxT("In file %s at line %d: '%s' failed with ") \
wxT("error 0x%08lx (%s)."), \
__FILE__, __LINE__, api, \
(long)rc, wxSysErrorMsg(rc))
(long)rc, wxSysErrorMsgStr(rc))
#endif // VC++/!VC++
#define wxLogLastError(api) wxLogApiError(api, wxSysErrorCode())

View File

@@ -418,7 +418,7 @@ wxLog::CallDoLogNow(wxLogLevel level,
{
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

View File

@@ -2411,7 +2411,7 @@ wxMBConv_iconv::ToWChar(wchar_t *dst, size_t dstLen,
if (ICONV_FAILED(cres, srcLen))
{
//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;
}
@@ -2479,7 +2479,7 @@ size_t wxMBConv_iconv::FromWChar(char *dst, size_t dstLen,
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;
}

View File

@@ -212,7 +212,7 @@ const wxString& wxDbgHelpDLL::GetErrorMessage()
void wxDbgHelpDLL::LogError(const wxChar *func)
{
::OutputDebugString(wxString::Format(wxT("dbghelp: %s() failed: %s\r\n"),
func, wxSysErrorMsg(::GetLastError())).t_str());
func, wxSysErrorMsgStr(::GetLastError())).t_str());
}
// ----------------------------------------------------------------------------

View File

@@ -470,7 +470,7 @@ wxString wxDialUpManagerMSW::GetErrorString(DWORD error)
{
case ERROR_INVALID_PARAMETER:
// this was a standard Win32 error probably
return wxString(wxSysErrorMsg(error));
return wxSysErrorMsgStr(error);
default:
{
@@ -1258,7 +1258,7 @@ static DWORD wxRasMonitorThread(wxRasThreadData *data)
(
wxT("WaitForMultipleObjects(RasMonitor) failed: 0x%08lx (%s)"),
err,
wxSysErrorMsg(err)
wxSysErrorMsgStr(err)
);
// no sense in continuing, who knows if the handles we're

View File

@@ -27,7 +27,7 @@
#include "wx/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
// standard Windows macros being defined without including the headers defining
@@ -84,7 +84,7 @@ public:
if ( !::CredWrite(&cred, 0) )
{
errmsg = wxSysErrorMsg();
errmsg = wxSysErrorMsgStr();
return false;
}
@@ -103,7 +103,7 @@ public:
// Not having the password for this service/user combination is not
// an error, but anything else is.
if ( ::GetLastError() != ERROR_NOT_FOUND )
errmsg = wxSysErrorMsg();
errmsg = wxSysErrorMsgStr();
return NULL;
}
@@ -123,7 +123,7 @@ public:
{
// Same logic as in Load() above.
if ( ::GetLastError() != ERROR_NOT_FOUND )
errmsg = wxSysErrorMsg();
errmsg = wxSysErrorMsgStr();
return false;
}

View File

@@ -1371,7 +1371,7 @@ void WXDLLIMPEXP_BASE wxWakeUpMainThread()
wxS("Failed to wake up main thread: PostThreadMessage(WM_NULL) ")
wxS("failed with error 0x%08lx (%s)."),
ec,
wxSysErrorMsg(ec)
wxSysErrorMsgStr(ec)
);
}
}