PRB: Cannot Cancel AsyncRead When Used With Local FilesID: Q190885
|
When using AsyncRead from a ActiveX Document or an ActiveX Control project running under Internet Explorer 4.x to download a local file, you cancel the operation by calling CancelAsyncRead. CancelAsyncRead does not work for local files.
Reading a local file is a Synchronous operation. For this reason the call to AsyncRead is completed before any subsequent lines of code are executed.
Private Sub UserDocument_AsyncReadComplete(AsyncProp as
AsyncProperty)
MsgBox "CancelAsyncRead didn't work. Downloaded " & _
AsyncProp.BytesRead & " Bytes"
End Sub
Private Sub UserDocument_Show()
'use a large file here
AsyncRead "c:\windows\system\mshtml.dll", vbAsyncTypeByteArray
MsgBox "Notice that CancelAsyncRead hasn't been called yet!"
CancelAsyncRead
End Sub
Additional query words:
Keywords : kbActiveDocs kbIE400 kbIE401 kbVBp600 kbIE500
Version : WINDOWS:4.0,4.01,6.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 30, 1999