|
-
Jan 31st, 2008, 02:21 AM
#1
Thread Starter
New Member
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 ^^
-
Jan 31st, 2008, 07:31 AM
#2
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?
-
Jan 31st, 2008, 01:08 PM
#3
Thread Starter
New Member
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 ^^
-
Jan 31st, 2008, 01:27 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|