Notifications
Clear all

Verificar Conexão com a Internet

2 Posts
1 Usuários
0 Reactions
1,134 Visualizações
(@fernandofernandes)
Posts: 43750
Illustrious Member
Topic starter
 

Para verificar conexão com a Internet, Tentei usar a função abaixo:

Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" _
(ByRef lpdwFlags As Long, _
ByVal lpszConnectionName As String, _
ByVal dwNameLen As Integer, _
ByVal dwReserved As Long) _
As Long

Dim sConnType As String * 255

Sub TesteConexaoInternet()
Dim Ret As Long
Ret = InternetGetConnectedStateEx(Ret, sConnType, 254, 0)
If Ret = 1 Then
MsgBox "Você está conectado a Internet via " & sConnType, vbInformation
Else
MsgBox "Você não está conectado a Internet", vbInformation
End If
End Sub

Mas uso Windows 7 - 64 bits. e dá erro pedindo atualização para 64 bits.
Alguem pode ajudar?
Grato,
Pedro

 
Postado : 01/08/2012 5:20 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
Topic starter
 

Bom dia!!

Você deveria tentar...

Você precisa mudar as declarações de 32 bits e tipos de variáveis ​​aos utilizados em versões de 64 bits do Office. Comece lendo isso ...
http://msdn.microsoft.com/en-us/library ... =office.11).aspx
http://www.jkp-ads.com/articles/apideclarations.asp

Att

 
Postado : 02/08/2012 4:07 am