-
How do I stop all internet activity (ITC, the Microsoft Internet Control) so that I can quit my program at any time without crashing.
I now use Inet1.Cancel In the Form_Unload, Form_Terminate and Form_QueryUnload
but it seems to wait before closing.
I think it's not good to just put an END after inet.cancel, will it crash the prog, make the system unstable?
-
What? Nobody knows?
I'm sure someone does!
-
I don't think there is a way to do it. Maybe this will work:
Code:
Inet1.Cancel
' Not sure if a Set Form1 = Nothing goes here
Unload Me
Set Form1 = Nothing
End
MSInet says that Cancel stops the process..from what I see, doesn't stop sh**!!
I tested it with Inet1.OpenURL("http://www.vb-world.net") and I put that code in the Unload event, and it just keeps crashing. But than I used the first Set Form1 = Nothing, kept the second there as well and all VB did was wait till the task was finished and then unloaded. Looks like your going to have to disable the Exit Button, or put something like:
Code:
If Inet1.StillExecuting = True Then
Exit Sub
Else
Unload Me
Set form1 = Nothing
End
End If
-
Ok thanx, i'll try it tomorrow
-
You could also keep trying to cancel it.
Code:
Do
Inet1.Cancel
DoEvents
Loop While Inet1.StillExecuting = True
Or this way:
Code:
Do Until Inet1.StillExecuting = False
Inet1.Cancel
DoEvents
Loop
-
What's the best way to do it do you think?
-
No Matter What you are going to have problems cancelling the Inet control.
Its IE right!?
ever try to stop a FTP transfer in IE... same thing... if microsoft can't their own control to work in their browser I doubt we can. Not saying that microsoft is great, just that its their control!
-
You cannot stop IE when you hit stop.
you can during HTTP and sometimes during FTP
But if for example a server is running very slow during the log in or file transfer you will NOT be able to stop it.
do this type
ftp://e.com
and then try to press STOP