|
-
Dec 8th, 2000, 09:46 PM
#1
Thread Starter
Banned
HTTP DownLoad
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, 07:10 PM
#2
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]
-
Jan 19th, 2001, 07:19 PM
#3
Thread Starter
Banned
what?
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
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
|