PDA

Click to See Complete Forum and Search --> : HTTP down loading (i need help w/ my code)


nukem996
Dec 8th, 2000, 08:46 PM
I need an http download. I got some code, but when the file size is really big the program's form gets all screwed up. Then Win comes up with a err msg that says, "Their isn’t any memory left, you should close some programs and then try again." Then win crashes. Can anyone tell me what I did wrong?


'Declares everything
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
'this downloads
Public Function DownloadFile(URL As String, _
LocalFilename As String) As Boolean

Dim lngRetVal As Long

lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)

If lngRetVal = 0 Then DownloadFile = True

End Function

Private Sub bntdl_Click()
'enter txt for site name
MsgBox DownloadFile(txtdl.Text, txtto.Text)
End Sub

Private Sub bntlocation_Click()
'to lazy to put the code in agien
mnudl_Click
End Sub

Private Sub bntsave_Click()
'where to save to
cdsave.ShowSave
txtto.Text = cdsave.FileName
End Sub

Private Sub mnudl_Click()
'where to dl from
txtdl.Text = InputBox("Enter URL")
End Sub

Private Sub mnudlfile_Click()
'where to save
bntsave_Click
End Sub

Private Sub mnuquit_Click()
'asks if ur sure u want to quit
Select Case MsgBox("Are you sure you want to quit?", vbYesNo)
Case vbYes
Unload Me
End
Case vbNo

End Select
End Sub

Private Sub mnuweb_Click()
bntdl_Click
End Sub

[Edited by nukem996 on 12-08-2000 at 10:11 PM]

Jan 19th, 2001, 06:10 PM
Text boxes can only hold 65535 characters (or something like that). Do a rich text box because I think that can hold more and it's got more functions to. I think this is what you are doing right?

[Edited by conquerdude on 01-19-2001 at 07:13 PM]

nukem996
Jan 19th, 2001, 06:19 PM
i went to try to find it and, i dont have a rich txt box. can u plz tell me the name of the ocx file so i can fix it.
thx