From c973625d01da35e5637e7d217bf615e206589933 Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 20 Nov 2007 16:07:06 +0000 Subject: [PATCH] Patch level :4.0 820 Files correlati : Ricompilazione Demo : [ ] Commento :aggiunto il metodo xvt_net_get_status() per sapere se il computer e' connesso ad una rete o ad internet (decisivo per poter avviare l'installazione via web) git-svn-id: svn://10.65.10.50/trunk@15770 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xvaga/xvaga.cpp | 22 ++++++++++++++++++++++ xvaga/xvt.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index f7bb944a8..a55b80017 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -4,6 +4,7 @@ #include "wx/calctrl.h" #include "wx/colordlg.h" #include "wx/confbase.h" +#include "wx/dialup.h" #include "wx/fileconf.h" #include "wx/fontdlg.h" #include "wx/fs_zip.h" @@ -4355,6 +4356,27 @@ BOOLEAN xvt_chr_is_alnum(int c) return (c <= 255) && wxIsalnum(c); } +int xvt_net_get_status() +{ + int nStatus = 0; + wxDialUpManager* dum = wxDialUpManager::Create(); + if (dum != NULL) + { + if (dum->IsOk() && dum->IsOnline()) + { + nStatus = 0x1; // 1 = Online + + if (dum->IsAlwaysOnline()) + nStatus |= 0x2; // 2 = Always Online + + wxArrayString isp; + if (dum->GetISPNames(isp) > 0) + nStatus |= 0x4; // 4 = Internet enabled + } + delete dum; + } + return nStatus; +} /////////////////////////////////////////////////////////// // XVT system calls (added by Guy) diff --git a/xvaga/xvt.h b/xvaga/xvt.h index b0a75ba3a..6feec3903 100755 --- a/xvaga/xvt.h +++ b/xvaga/xvt.h @@ -370,6 +370,8 @@ XVTDLL ULONG xvt_odbc_execute(XVT_ODBC handle, const char* sql, ODBC_CALLBACK cb XVTDLL BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn, const char* subject, const char* msg, const char* attach, BOOLEAN ui); +XVTDLL int xvt_net_get_status(); + #ifdef __cplusplus } #endif