Downloading a file from internet? - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html) +--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html) +--- Thread: Downloading a file from internet? (/thread-6193.html) |
Downloading a file from internet? - gbos - 02-22-2005 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. 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 Downloading a file from internet? - Antoni Gual - 02-22-2005 Perhaps you're supposed to open a socket using winsock before calling this function... Downloading a file from internet? - v3cz0r - 02-22-2005 Try redeclaring all string arguments as BYVAL, that will tell FB to pass the address of the string data (that what the API wants), not the string descriptor (that what BYREF will do). Downloading a file from internet? - gbos - 02-22-2005 :bounce: Thanks a lot !!! The code is working now. Code: '$include: 'win\kernel32.bi' |