Member_3480671
asked on
URLDownloadToFile, wrong URL?
I tried to download the following page using URLDownloadToFile:
http://www.postbank.nl/ing/pp/page/stockexchange/quotes/index/pb/0,2830,1859_270652,00.html
I entered the URL in the internet explorer and I get the right page on screen.
In my program, however, no file is created by the call:
URLDownloadToFile(NULL, URLtoaccess, filename, 0, NULL);
with the specified URL in URLtoaccess and a valid file name in filename.
My code works fine with other links I tried; therefor, is something wrong with the URL?
Thanks in advance, Stuart
http://www.postbank.nl/ing/pp/page/stockexchange/quotes/index/pb/0,2830,1859_270652,00.html
I entered the URL in the internet explorer and I get the right page on screen.
In my program, however, no file is created by the call:
URLDownloadToFile(NULL, URLtoaccess, filename, 0, NULL);
with the specified URL in URLtoaccess and a valid file name in filename.
My code works fine with other links I tried; therefor, is something wrong with the URL?
Thanks in advance, Stuart
ASKER
I use this code:
int Function(char *URLname, char *filename){
switch(URLDownloadToFile(N ULL, URLname, filename, 0, NULL)){
case E_OUTOFMEMORY:
SetDlgItemText(hwndDlg,ID_ TERRORS,"E rrors: insufficient memory.");
return 0;
case E_UNEXPECTED:
SetDlgItemText(hwndDlg,ID_ TERRORS,"E rrors: unknown.");
return 0;
}
return 1;
}
The return value of Function() is 1, but no file is being created.
The code works with others URLs, like "http://www.beurs.nl". You don't believe anything's
wrong with this URL, even though it's loaded by the internet explorer?
int Function(char *URLname, char *filename){
switch(URLDownloadToFile(N
case E_OUTOFMEMORY:
SetDlgItemText(hwndDlg,ID_
return 0;
case E_UNEXPECTED:
SetDlgItemText(hwndDlg,ID_
return 0;
}
return 1;
}
The return value of Function() is 1, but no file is being created.
The code works with others URLs, like "http://www.beurs.nl". You don't believe anything's
wrong with this URL, even though it's loaded by the internet explorer?
ASKER
Please, help me!
I increased the value to 100 points, it's pretty urgent...
Stuart
I increased the value to 100 points, it's pretty urgent...
Stuart
I don't really know. Try catching the exact return value, maybe it's not S_OK for some reason.
corey
corey
here is the error I get when I try it. Even if I put Google into the url.
// MessageId: MK_E_SYNTAX
//
// MessageText:
//
// Invalid syntax
//
#define MK_E_SYNTAX _HRESULT_TYPEDEF_(0x800401 E4L)
// MessageId: MK_E_SYNTAX
//
// MessageText:
//
// Invalid syntax
//
#define MK_E_SYNTAX _HRESULT_TYPEDEF_(0x800401
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
corey