Please excuse if this isnot the right forum to post this...Here is something that works on vb but doesnot seem to be working with C++
its being used like this:PHP Code:bool DownloadFile(char* remote, char*local){
return (URLDownloadToFile(0, remote,local,0,0)==S_OK);
}
which doesnot seem to be working...On the other hand the same thing in vb works quite fine...PHP Code:LPSTR listAddr = "http://kaillera.com/raw_server_list2.php";
LPSTR srvFullRaw = "C:\\srvList.raw";
if(DownloadFile(listAddr,srvFullRaw))
etc...
Just wondering what was wrong with the C++ code and how I might go around fixing it.Code:Public 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 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 Sub Main() DownloadFile "http://kaillera.com/raw_server_list2.php", "C:\srvList.raw" End Sub
Thanks


Reply With Quote

Bookmarks