X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fcec64291df806fc7810440f93ba83ec2043062b..e7ca6139d062c37cc7c056b6647097e999b714cd:/src/msw/dialup.cpp diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index 6e90cfb09f..ff5cdfa3db 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -52,8 +52,15 @@ #include "wx/dialup.h" -// Doesn't yet compile under VC++ 4, BC++, mingw, Watcom C++: no wininet.h -#if !defined(__BORLANDC__) && !defined(__GNUWIN32_OLD__) && !defined(__GNUWIN32__) && !defined(__WATCOMC__) && ! (defined(__VISUALC__) && (__VISUALC__ < 1020)) +DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED) +DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED) + +// Doesn't yet compile under VC++ 4, BC++, Watcom C++: no wininet.h +#if !defined(__BORLANDC__) && \ + (!defined(__GNUWIN32__) || wxCHECK_W32API_VERSION(0, 5)) && \ + !defined(__GNUWIN32_OLD__) && \ + !defined(__WATCOMC__) && \ + (!defined(__VISUALC__) || (__VISUALC__ >= 1020)) #include #include @@ -516,7 +523,7 @@ HRASCONN wxDialUpManagerMSW::FindActiveConnection() { // an error occured wxLogError(_("Cannot find active dialup connection: %s"), - GetErrorString(dwRet)); + GetErrorString(dwRet).c_str()); return 0; } } @@ -637,7 +644,7 @@ void wxDialUpManagerMSW::OnDialProgress(RASCONNSTATE rasconnstate, if ( dwError ) { wxLogError(_("Failed to establish dialup connection: %s"), - GetErrorString(dwError)); + GetErrorString(dwError).c_str()); // we should still call RasHangUp() if we got a non 0 connection if ( ms_hRasConnection ) @@ -696,7 +703,8 @@ size_t wxDialUpManagerMSW::GetISPNames(wxArrayString& names) const else if ( dwRet != 0 ) { // some other error - abort - wxLogError(_("Failed to get ISP names: %s"), GetErrorString(dwRet)); + wxLogError(_("Failed to get ISP names: %s"), + GetErrorString(dwRet).c_str()); free(rasEntries); @@ -856,9 +864,17 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP, if ( dwRet != 0 ) { +#if wxUSE_UNICODE + // can't pass a wxWCharBuffer through ( ... ) + wxLogError(_("Failed to %s dialup connection: %s").data(), + async ? _("initiate").data() : _("establish").data(), + GetErrorString(dwRet).c_str()); +#else + // can't pass a wxWCharBuffer through ( ... ) wxLogError(_("Failed to %s dialup connection: %s"), - async ? _("initiate") : _("establish"), - GetErrorString(dwRet)); + wxString(async ? _("initiate") : _("establish")).c_str(), + GetErrorString(dwRet).c_str()); +#endif // we should still call RasHangUp() if we got a non 0 connection if ( ms_hRasConnection ) @@ -930,7 +946,7 @@ bool wxDialUpManagerMSW::HangUp() if ( dwRet != 0 ) { wxLogError(_("Failed to terminate the dialup connection: %s"), - GetErrorString(dwRet)); + GetErrorString(dwRet).c_str()); } ms_isConnected = FALSE; @@ -952,7 +968,7 @@ bool wxDialUpManagerMSW::IsAlwaysOnline() const wxDllType hDll = wxDllLoader::LoadLibrary(_T("WININET"), &ok); if ( ok ) { - typedef BOOL (*INTERNETGETCONNECTEDSTATE)(LPDWORD, DWORD); + typedef BOOL (WINAPI *INTERNETGETCONNECTEDSTATE)(LPDWORD, DWORD); INTERNETGETCONNECTEDSTATE pfnInternetGetConnectedState; #define RESOLVE_FUNCTION(type, name) \ @@ -1161,7 +1177,7 @@ bool wxDialUpManagerMSW::EnableAutoCheckOnlineStatus(size_t nSeconds) if ( dwRet != 0 ) { wxLogDebug(wxT("RasConnectionNotification() failed: %s"), - GetErrorString(dwRet)); + GetErrorString(dwRet).c_str()); CleanUpThreadData(); }