Inet State gets fire when you use Inet1.Execute or Inet1.OpenURL
Try this one:
Code:
'OVERALL: Retrieve server response
Private Sub Inet1_StateChanged(ByVal State As Integer)
' Return ResponseCode and ResponseInfo.
If State = icError Then MsgBox Inet1.ResponseCode & ":" & Inet1.ResponseInfo
Select Case State
'Case icHostResolvingHost
' List1.AddItem "icHostResolvingHost"
Case icHostResolved
List1.AddItem "icHostResolved"
Case icConnecting
List1.AddItem "icConnecting"
Case icConnected
List1.AddItem "icConnected"
Case icRequesting
List1.AddItem "icRequesting"
Case icRequestSent
List1.AddItem "icRequestSent"
Case icReceivingResponse
List1.AddItem "icReceivingResponse"
Case icResponseReceived
List1.AddItem "icResponseReceived"
Case icDisconnecting
List1.AddItem "icDisconnecting"
Case icDisconnected
List1.AddItem "icDisconnected"
Case icResponseCompleted
List1.AddItem "icResponseCompleted"
End Select
End Sub
this doesnt work..whats wrong?
Dim b() As Byte
Dim intRemoteVer As Integer
Dim strRemoteVer As String
Private Sub Form_Load()
Form1.Show
b() = InetUpdate.OpenURL("http://*********/update.exe", 1)
Open App.Path & "\update.exe" For Binary Access Write As #1
Put #1, , b()
Close 1
Label1.Caption = "Update Complete!"
Kill App.Path & "\test.exe"
Name App.Path & "\update.exe" As App.Path & "\test.exe"
MsgBox "Update Complete!"
End Sub
Private Sub InetUpdate_StateChanged(ByVal State As Integer)
MsgBox "test"
If State = icConnecting Then
Label1.Caption = "Connecting to server..."
ElseIf State = icConnected Then
Label1.Caption = "Connected. Downloading update..."
ElseIf State = icError Then
Label1.Caption = "Error connecting to server."
End If
End Sub
...
It never hits the statechanged sub (ie the msgbox never pops up..)