[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

URLDownloadToFile, wrong URL?

Posted on 2005-05-09
6
Medium Priority
?
722 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:stuartdehaan
  • 2
  • 2
  • 2
6 Comments
 
LVL 8

Expert Comment

by:_corey_
ID: 13961807
Please post the section of code downloading the URL and the HRESULT value returned by URLDownloadToFile().

corey
0
 
LVL 1

Author Comment

by:stuartdehaan
ID: 13966701
I use this code:
int Function(char *URLname, char *filename){
switch(URLDownloadToFile(NULL, URLname, filename, 0, NULL)){
       case E_OUTOFMEMORY:
      SetDlgItemText(hwndDlg,ID_TERRORS,"Errors: insufficient memory.");
      return 0;
      case E_UNEXPECTED:
      SetDlgItemText(hwndDlg,ID_TERRORS,"Errors: 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?
0
 
LVL 1

Author Comment

by:stuartdehaan
ID: 13977921
Please, help me!
I increased the value to 100 points, it's pretty urgent...

Stuart
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Expert Comment

by:_corey_
ID: 13978323
I don't really know.  Try catching the exact return value, maybe it's not S_OK for some reason.

corey
0
 
LVL 1

Expert Comment

by:cafechris
ID: 14167373
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_(0x800401E4L)
0
 
LVL 1

Accepted Solution

by:
cafechris earned 400 total points
ID: 14167495
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question