Solved

Little problem with Inet

Posted on 2002-06-23
5
212 Views
Last Modified: 2010-05-02
I have to download the HTML of a page that is very big so I want that while its being downloded, to put the HTML in a Textbox. This is how I'm trying that:


If State = 12 Or State = 8 Then

    bloque = Inet1.GetChunk(1024, icString)
    DoEvents
    Do While Not bDone
       des = des & bloque
       DoEvents
       ' Obtiene el bloque siguiente.
       bloque = Inet1.GetChunk(1024, icString)
       If Len(des) = 0 Then
          bDone = True
       End If
    Loop
end if

But I get some errors. I dont use just the state 12 because it will waits until the whole page is downloaded...

What can I do?
0
Comment
Question by:DImirC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Accepted Solution

by:
Toad224 earned 200 total points
ID: 7102474
Why don't you try this...  It seems to work well for me...

Private Sub Command1_Click()
Inet1.Execute "http://www.microsoft.com/"
End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
 Select Case State
        Case icResponseCompleted
            Do
                DoEvents
                strBuffer = Inet1.GetChunk(1024)
                Text1.Text = Text1.Text & strBuffer
            Loop Until Len(strBuffer) = 0
End Select
End Sub


I hope this helps.  Good luck!
0
 

Author Comment

by:DImirC
ID: 7111308
But the problem is that the page is very very big, about 5000 lines, so I dont want to wait until it is complete... I want the HTML to be shown inmediatly after its downloaded
0
 
LVL 1

Expert Comment

by:Toad224
ID: 7111324
When I use the code I put above, it shows the downloaded data as it is downloaded instead of waiting until it's complete.  Do    strBuffer = Inet1.GetChunk(10)    instead of the 1024 one to see the data appear faster.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7962856
Hi DImirC,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Toad224's comment(s) as an answer.
    *** I don't think the answer is 100% correct since the code needs to handle icResponseReceived, but it does show that the text must be appended to the output as it comes in.

DImirC, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 8022916
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month6 days, 22 hours left to enroll

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question