02-22-2005, 03:32 PM
I tried to make it work in freebasic but no luck so far :oops:
It is supposed to download a txt file from a specific location. It compiles fine but it doesnât download the file. Any thoughts what I am doing wrong.
It is supposed to download a txt file from a specific location. It compiles fine but it doesnât download the file. Any thoughts what I am doing wrong.
Code:
'' Function FGetFileHTTP_URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByRef szURL As String, ByRef szFileName As String,ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
'$include: 'win\kernel32.bi'
Dim dummy as long
Dim url$
Dim OFile$
url$="http://www.ase.gr/content/gr/MarketData/Stocks/Prices/Files/txt/20050221.txt"
OFile$="quotes.txt"
Dim FGetFileHTTP_URLDownloadToFile as function (ByVal pCaller As Long, ByRef szURL As String, ByRef szFileName As String,ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
dim hlib as integer
hlib = LoadLibrary("urlmon.dll")
FGetFileHTTP_URLDownloadToFile = GetProcAddress( hlib, "URLDownloadToFileA" )
dummy = FGetFileHTTP_URLDownloadToFile (0, url$, OFile$,0, 0)
sleep