FIX: GetChunk Freezes Unless Other Events Happening
ID: Q171829
|
The information in this article applies to:
-
Microsoft Visual Basic Enterprise Edition for Windows, version 5.0
on the following platforms: Alpha
SYMPTOMS
The GetChunk operation pauses unless other events are happening. Other
events could include moving the mouse, which would trigger the GetChunk to
continue.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Studio
97 Service Pack 2.
For more information on the Visual Studio Service Pack 2, please see the
following article in the Microsoft Knowledge Base:
Q170365
: INFO: Visual Studio 97 Service Packs - What, Where, and Why
For a list of the Visual Basic 5.0 bugs that were fixed in the Visual
Studio 97 Service Pack 2, please see the following article in the Microsoft
Knowledge Base:
Q171554
: INFO: Visual Basic 5.0 Fixes in Visual Studio 97 Service Pack 2
MORE INFORMATIONSteps to Reproduce Behavior
- Run Visual Basic or, if Visual Basic is already running, choose New
Project from the File menu (ALT, F, N). Form1 is created by default.
Add the following code to the General Declarations of Form1:
Option Explicit
Private bwait As Boolean
- Place an Internet Transfer Control (Inet1) on Form1, and add the
following code:
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim s$, t$
Debug.Print "StateChanged:", State
If State = icResponseCompleted Then
t$ = ""
s$ = Inet1.GetChunk(1024)
DoEvents
While Len(s$) <> 0
t$ = t$ & s$
s$ = Inet1.GetChunk(1024)
DoEvents: DoEvents: DoEvents
Debug.Print ".";
Wend
Debug.Print
Debug.Print Left$(t$, 20), Len(t$)
bwait = True
End If
End Sub
- Place a CommandButton (Command1) on Form1, and add the following code:
Private Sub Command1_Click()
Dim i As Integer
Dim tmp As Single
For i = 1 To 5
tmp = Timer
While tmp + 1 > Timer
DoEvents: DoEvents: DoEvents
Wend
bwait = False
Inet1.Execute "http://msw"
While Not (bwait)
DoEvents
Wend
Next
End Sub
- Press the F5 key to run it, and then press the ENTER key to invoke the
command_click. (NOTE: Do not move the mouse or touch the keyboard.)
- Watch your debug window. The first time you access the page, it works.
However, the second time, you need to pause. Press Ctrl-break quickly
and you are at the Doevents statement following the GetChunk. If you
move the mouse, the GetChunk will continue.
Additional query words:
Keywords : kbVBp500 kbVS97sp2fix kbvbp500sp2fix
Version : WINDOWS:5.0
Platform : NT WINDOWS
Issue type : kbbug
|