Re: URLDownloadToFile Errors
On Jul 10, 5:16 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:
alphaLa...@gmail.com wrote:
On Jul 10, 4:16 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:
int main()
{
long int returnValue = 0;
LPCTSTR URL =
"ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/EICK.TXT";
LPCTSTR FILENAME = "c:\\wx.txt";
returnValue = URLDownloadToFile(NULL, URL, FILENAME, 0, NULL);
return 0;
}
Thank you! I just edited the program, but it's actually still giving
me the exact same error message: "error C2440: 'initializing' : cannot
convert from 'const char [67]' to 'LPCTSTR'.
Sorry, my bad. Should be
LPCTSTR URL =
_T("ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/EICK.TXT");
LPCTSTR FILENAME = _T("c:\\wx.txt");
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925- Hide quoted text -
- Show quoted text -
Ok, I'm getting places now. I have a linker error...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++
#include "stdafx.h"
//#include "afxinet.h"
#include <iostream>
#include "Urlmon.h"
using namespace std;
int main()
{
long int returnValue = 0;
LPCTSTR URL = _T("ftp://tgftp.nws.noaa.gov/data/observations/metar/
stations/EICK.TXT");
LPCTSTR FILENAME = _T("c:\\wx.txt");
returnValue = URLDownloadToFile(NULL, URL, FILENAME, 0, NULL);
return 0;
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++
"fetchMET.obj : error LNK2019: unresolved external symbol
_URLDownloadToFileW@20 referenced in function _main
C:\Documents and Settings\Guest\My Documents\Visual Studio
2005\Projects\fetchMET\Debug\fetchMET.exe : fatal error LNK1120: 1
unresolved externals"
Have I left out an appropriate header file?