Results 1 to 4 of 4

Thread: VB6 Problem with Inet controler... !?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    2

    VB6 Problem with Inet controler... !?

    Hello, I have a big problem with my code (old vb6 code... my server is reopenning...)

    Here is my code...

    Code:
    Private Function Getfile(site, file As String)
        'Name of the updated exe
        'RemoteFileToGet = site & updatelist
    
        FirstResponse = False
        m_FileSize = GetHTTPFileSize(site & file)
        While Inet1.StillExecuting = True
            DoEvents  <<<<<<<=============================
        Wend
        lblStatus.Caption = "Détermination de la taille du fichier..."
        'lblInfo.Caption = "0/" & (m_FileSize)
        lblInfo.Caption = (m_FileSize) & " octets"
        pbfile.Value = 0
        m_LocalSaveFile = Path & file
        'Inet1.Execute RemoteFileToGet, "GET " & Chr(34) & m_LocalSaveFile & Chr(34)
        Inet1.Execute site & file, "GET " & Chr(34) & m_LocalSaveFile & Chr(34)
    End Function
    It bugs at the DoEvents... I don't know why... on my computer it works fine... and on other computer... sometimes cannot works fines... =/

    I check all DLL, and all DLL is okay... I don't know... really, and I need my patcher ASAP!

    Thanks you for your help ^^

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: VB6 Problem with Inet controler... !?

    Welcome to the forums.

    What does it do on the other computer?

    Did you do a formal installation and setup to run it on the other machine?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    2

    Re: VB6 Problem with Inet controler... !?

    Yep, full installation with dlls :

    ; [Bootstrap Files]
    ; @VB6FR.DLL,$(WinSysPath),,$(Shared),7/13/98 12:00:00 AM,119568,5.0.81.69
    Source: C:\VB6FR.DLL; DestDir: {sys}; Flags: promptifolder sharedfile
    ; @COMCAT.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,6/1/98 12:00:00 AM,22288,4.71.1460.1
    Source: C:\COMCAT.DLL; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile regserver
    ; @STDOLE2.TLB,$(WinSysPathSysFile),$(TLBRegister),,12/18/98 1:27:10 PM,17920,2.40.4268.1
    Source: C:\STDOLE2.TLB; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile regtypelib
    ; @ASYCFILT.DLL,$(WinSysPathSysFile),,,12/18/98 1:27:44 PM,147728,2.40.4268.1
    Source: C:\ASYCFILT.DLL; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile
    ; @OLEPRO32.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,12/18/98 2:17:36 PM,164112,5.0.4268.1
    Source: C:\OLEPRO32.DLL; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile regserver
    ; @OLEAUT32.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,12/18/98 1:27:46 PM,598288,2.40.4268.1
    Source: C:\OLEAUT32.DLL; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile regserver
    ; @MSVBVM60.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,9/25/98 12:00:00 AM,1409024,6.0.82.68
    Source: C:\\KitVb6\MSVBVM60.DLL; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile regserver
    Source: C:\KitVb6\MSCOMCTL.OCX; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile regserver
    Source: C:\KitVb6\Comdlg32.ocx; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile regserver
    Source: C:\KitVb6\MSINET.OCX; DestDir: {sys}; Flags: restartreplace uninsneveruninstall sharedfile regserver

    All the dll's correctly installed... I don't know where is the problem...

    On the other computer, the program freeze at the DoEvents, thats it...

    Thank you ^^

  4. #4
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: VB6 Problem with Inet controler... !?

    I had some issues with Inet and i switched to this:
    http://www.vbforums.com/showthread.php?t=506463
    The code
    Try this
    Add reference to WinHTTP.dll in systems32. (Browse to it, if Microsoft WinHTTP services doesn't show on the references list.)

    Note this simple example doesn't do anything fancy, just dumps the downloaded bytes to disk.

    OnResponseStart when you can safely access the headers.
    OnResponseDataAvailable which returns a byte array of downloaded data for each chunk.
    OnResponseEnd which ends the download.


    Option Explicit
    Private WithEvents http As WinHttpRequest
    Private mContentLength As Long
    Private mProgress As Long

    Private Sub Command1_Click()
    ' Create the WinHTTPRequest ActiveX Object.
    Set http = New WinHttpRequest
    ' Open an HTTP connection.
    http.open "GET", "http://home.in.tum.de/~paula/mpeg/wg_gdo_1.mpg", True 'True means asynch.
    ' Send the HTTP Request.
    http.send
    End Sub

    Private Sub http_OnResponseDataAvailable(Data() As Byte)
    mProgress = mProgress + UBound(Data) + 1
    ProgressBar1.Value = mProgress

    Put #1, , Data


    End Sub

    Private Sub http_OnResponseFinished()
    Close #1
    MsgBox "done"
    End Sub

    Private Sub http_OnResponseStart(ByVal Status As Long, ByVal ContentType As String)
    Text1.Text = http.getAllResponseHeaders()
    mProgress = 0
    mContentLength = CLng(http.getResponseHeader("Content-Length"))

    ProgressBar1.Max = mContentLength
    Open "C:\twg_gdo_1.mpg" For Binary As #1

    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width