#ifndef WX_PRECOMP
#include "wx/log.h"
+ #include "wx/intl.h"
+ #include "wx/event.h"
+#endif
+
+#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
#include "wx/dynlib.h"
#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))
+
#include <ras.h>
#include <raserror.h>
#include <wininet.h>
-#include "wx/msw/private.h"
+// Not in VC++ 5
+#ifndef INTERNET_CONNECTION_LAN
+#define INTERNET_CONNECTION_LAN 2
+#endif
+#ifndef INTERNET_CONNECTION_PROXY
+#define INTERNET_CONNECTION_PROXY 4
+#endif
// ----------------------------------------------------------------------------
// constants
bool async)
{
// check preconditions
- wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), FALSE, wxT("using uninitialized wxDialUpManager") );
if ( ms_hRasConnection )
{
- wxFAIL_MSG(T("there is already an active connection"));
+ wxFAIL_MSG(wxT("there is already an active connection"));
return TRUE;
}
return FALSE;
}
- wxASSERT_MSG( ms_hRasConnection, T("dialing but no connection?") );
+ wxASSERT_MSG( ms_hRasConnection, wxT("dialing but no connection?") );
ms_dialer = NULL;
bool wxDialUpManagerMSW::HangUp()
{
- wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), FALSE, wxT("using uninitialized wxDialUpManager") );
// we may terminate either the connection we initiated or another one which
// is active now
}
}
- wxASSERT_MSG( ms_isAlwaysOnline != -1, T("logic error") );
+ wxASSERT_MSG( ms_isAlwaysOnline != -1, wxT("logic error") );
return ms_isAlwaysOnline != 0;
}
bool wxDialUpManagerMSW::IsOnline() const
{
- wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), FALSE, wxT("using uninitialized wxDialUpManager") );
if ( ms_userSpecifiedOnlineStatus != -1 )
{
void wxDialUpManagerMSW::SetOnlineStatus(bool isOnline)
{
- wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") );
+ wxCHECK_RET( IsOk(), wxT("using uninitialized wxDialUpManager") );
ms_userSpecifiedOnlineStatus = isOnline;
}
bool wxDialUpManagerMSW::EnableAutoCheckOnlineStatus(size_t nSeconds)
{
- wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), FALSE, wxT("using uninitialized wxDialUpManager") );
bool ok = ms_pfnRasConnectionNotification != 0;
{
// create a hidden window to receive notification about connections
// status change
- extern wxChar wxPanelClassName[];
+ extern const wxChar *wxPanelClassName;
ms_hwndRas = ::CreateWindow(wxPanelClassName, NULL,
0, 0, 0, 0,
0, NULL,
if ( dwRet != 0 )
{
- wxLogDebug(T("RasConnectionNotification() failed: %s"),
+ wxLogDebug(wxT("RasConnectionNotification() failed: %s"),
GetErrorString(dwRet));
CleanUpThreadData();
void wxDialUpManagerMSW::DisableAutoCheckOnlineStatus()
{
- wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") );
+ wxCHECK_RET( IsOk(), wxT("using uninitialized wxDialUpManager") );
if ( m_hThread )
{
void wxDialUpManagerMSW::SetWellKnownHost(const wxString& WXUNUSED(hostname),
int WXUNUSED(port))
{
- wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") );
+ wxCHECK_RET( IsOk(), wxT("using uninitialized wxDialUpManager") );
// nothing to do - we don't use this
}
void wxDialUpManagerMSW::SetConnectCommand(const wxString& WXUNUSED(dial),
const wxString& WXUNUSED(hangup))
{
- wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") );
+ wxCHECK_RET( IsOk(), wxT("using uninitialized wxDialUpManager") );
// nothing to do - we don't use this
}
{
wxDialUpManagerMSW *dialUpManager = wxDialUpManagerMSW::GetDialer();
- wxCHECK_RET( dialUpManager, T("who started to dial then?") );
+ wxCHECK_RET( dialUpManager, wxT("who started to dial then?") );
SendMessage(dialUpManager->GetRasWindow(), wxWM_RAS_DIALING_PROGRESS,
rasconnstate, dwError);
}
+#endif
+ // __BORLANDC__
#endif // wxUSE_DIALUP_MANAGER