]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialup.cpp
changed return type of RGBColor to const Reference (avoiding compiler warnings)
[wxWidgets.git] / src / msw / dialup.cpp
index 910b0aa98d0ac776c2035575c193abda5200f089..b3ac982fcfe9aadb425cc5b0bef8af57a9b61c5c 100644 (file)
 
 #include "wx/msw/private.h"  // must be before #include "dynlib.h"
 
-#if !wxUSE_DYNLIB_CLASS
-    #error You need wxUSE_DYNLIB_CLASS to be 1 to compile dialup.cpp.
-#endif
-
+#if wxUSE_DYNAMIC_LOADER || wxUSE_DYNLIB_CLASS
 #include "wx/dynlib.h"
+#else
+#error You need wxUSE_DYNAMIC_LOADER to be 1 to compile dialup.cpp.
+#endif
 
 #include "wx/dialup.h"
 
 DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED)
 DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED)
 
-// 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))
+// 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 <ras.h>
 #include <raserror.h>
@@ -351,7 +355,7 @@ wxDialUpManagerMSW::wxDialUpManagerMSW()
     if ( !ms_nDllCount++ )
     {
         // load the RAS library
-        ms_dllRas = wxDllLoader::LoadLibrary("RASAPI32");
+        ms_dllRas = wxDllLoader::LoadLibrary(_T("RASAPI32"));
         if ( !ms_dllRas )
         {
             wxLogError(_("Dial up functions are unavailable because the remote access service (RAS) is not installed on this machine. Please install it."));
@@ -860,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"),
+                   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 )
@@ -952,11 +964,10 @@ bool wxDialUpManagerMSW::IsAlwaysOnline() const
     }
 
     // try to use WinInet function first
-    bool ok;
-    wxDllType hDll = wxDllLoader::LoadLibrary(_T("WININET"), &ok);
-    if ( ok )
+    wxDllType hDll = wxDllLoader::LoadLibrary(_T("WININET"));
+    if ( hDll )
     {
-        typedef BOOL (*INTERNETGETCONNECTEDSTATE)(LPDWORD, DWORD);
+        typedef BOOL (WINAPI *INTERNETGETCONNECTEDSTATE)(LPDWORD, DWORD);
         INTERNETGETCONNECTEDSTATE pfnInternetGetConnectedState;
 
         #define RESOLVE_FUNCTION(type, name) \