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]