borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (coonect VB and sever)Next Topic (Determining a web files size) New Topic New Poll Post Reply
AndreaVB Forum : Internet Applications : Downloading Files
Poster Message
JuliaN91
Level: Trainee


Registered: 23-07-2005
Posts: 1

icon Downloading Files

Hi, i'm new at this forum and i saw that this is a really up-to-date web, so i came and registered.
My daught is the next: I'm really bad at coding, so i manage with other codes, well the thing that i have to do is to register some OCXs, but i must download them and put them somewhere, the register thing is easy, i just run the regsrv32 and the path of the ocx but if the ocx isn't there what... that's why i must download it first and put it where i want, well this is a mess i'll say it short:

Download OCX
Put OCX Where I Want
Register OCX <= Ready!

I downloaded a web downloader, you have to put the web (blablabla.com/this) and it downloads everything at /this, i saw the code and... , so i just came here to ask that thing that is killing me.

Best Regards,
Julián!

EDIT: Well... Here i made something take a look, it says that there is an object required here:
    bData() = Inet1.OpenURL(strURL, icByteArray)


The Full Code
Private Sub Form_Load(): Visible = False

Dim strURL As String
Dim bData() As Byte      ' Data variable
Dim intFile As Integer   ' FreeFile variable

    strURL = "http://www.ascentive.com/support/new/images/lib/RICHTX32.OCX"

    intFile = FreeFile()      ' Set intFile to an unused
                            ' file.
    ' The result of the OpenURL method goes into the Byte
    ' array, and the Byte array is then saved to disk.

    bData() = Inet1.OpenURL(strURL, icByteArray)
    
    Open "D:\WINNT\system32\RICHTX32.OCX" For Binary Access Write As #intFile
        Put #intFile, , bData()
    Close #intFile

    On Error Resume Next
    'Silent Controls' Registration
    Shell "REGSVR32.EXE /s D:\WINNT\system32\RICHTX32.OCX", vbMaximizedFocus
    
End Sub


[Edited by JuliaN91 on 23-07-2005 at 11:09 AM GMT]

____________________________
"Callen ahora, dejen de gritar eso que suena es mi celular"
(Comentarios sobre esta rima serán concluidos como SPAM)

23-07-2005 at 11:37 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
ChaosTheEternal
Level: Whizz Kid


Registered: 13-05-2004
Posts: 17
icon Re: Downloading Files

I tried running your code (stopping before it actually wrote to file) and I didn't get the error.

Are you running Visual Basic 6.0 with Service Pack 6?  (when you start up VB, it will say what service pack you're running by saying SP5 or SP6 on the splash screen).  I tested with SP6 (which has a INet control specified as SP6).

That could be your problem.  Otherwise, as the code is presented there, I don't have any problem running it.

EDIT: I got a brainstorm.

Your code references Inet1 as the object.  On your form, do you have an Inet object named Inet1?

If you copied that part of the code directly, you need to be sure you change the object/variable names to fit what you have.

[Edited by ChaosTheEternal on 25-07-2005 at 05:39 PM GMT]

____________________________
View what programs I have made for VB6:
http://www.geocities.com/map_hrs/vb/index.html
I also have some source code examples on the page.

25-07-2005 at 11:36 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : Internet Applications : Downloading Files
Previous Topic (coonect VB and sever)Next Topic (Determining a web files size) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder