Hei alle.
Hva er galt med denne koden? Den virker utmerket fra VB, men når den
kompileres så henger programmet og ingenting blir lastet ned.
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
Private Const ERROR_SUCCESS As Long = 0
Public Function DownloadFile(sSourceUrl As String, _
sLocalFile As String) As Boolean
DownloadFile = URLDownloadToFile(0&, _
sSourceUrl, _
sLocalFile, _
0&, _
0&) = ERROR_SUCCESS
End Function
terje
|