Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Little problem with Inet

Posted on 2002-06-23
5
Medium Priority
?
214 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 800 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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

722 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