|
-
Jul 19th, 2000, 10:48 AM
#1
Thread Starter
Junior Member
I have a program that uses the Inet control. My problem is once it encounters an error (icError in StateChanged event to be specific) my program will freeze. I've tried to issue an Inet.Cancel statement but to no avail. HELP!!!
Here's a portion of my code....
Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error GoTo Errors
Select Case State
Case icNone
Me.Caption = ""
.
.
.
Case icError
Inet1.Cancel
Case icResponseCompleted
Me.Caption = "Completed..."
End Select
End Sub
[Edited by jsayson on 07-19-2000 at 01:06 PM]
-
Jul 20th, 2000, 12:51 AM
#2
Lively Member
Cancel method not working great. But if you want using Cancel try this.
Do While Inet1.StillExecuting
Inet1.Cancel
DoEvents
Loop
-Dj4
-
Jul 20th, 2000, 07:49 AM
#3
Thread Starter
Junior Member
O yah, that's a great idea. But what I want is for my program to exit gracefully in case it encounters the icError state.
-
Jul 21st, 2000, 12:50 AM
#4
Lively Member
I don't know how that works but try:
Select Case State
...
Case icError
Inet1.Execute , "QUIT"
Do
DoEvents
Loop While Inet1.StillExecuting
OR
Inet1.Execute , "CLOSE"
Do
DoEvents
Loop While Inet1.StillExecuting
End Select
-Dj4
-
Jul 21st, 2000, 10:37 AM
#5
Thread Starter
Junior Member
I think the example you've shown to me works only on FTP. Here's my inet statement.
public function xxxx()
do until ....
inet1.cancel
Buffer = Inet1.OpenURL(txtURL.Text, icString)
......process the contents of buffer here
loop
end function
what my appl will do is to retrieve the HTML code of the given URL only not download it. usually my appl will be able to loop and retrieve a few thousands of data before it encounters the icError. And once it encounters the error it immediately hung's up. I suspect that error is related to timeout request, but what I want is for my program to exit gracefully instead of being locked-up.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|