Search:
Forum
General C++ Programming
UrlDownloadToFileA Error
UrlDownloadToFileA Error
May 15, 2021 at 10:45pm UTC
x01337
(3)
Hi everyone!
I've been trying to use the AuthGG native C++ example,
and when i try to call the UrlDownloadToFileA function,
i keep getting unresolved external symbols. The example uses cryptopp library, etc.
```
#include <urlmon.h>
#pragma comment(lib , "urlmon.lib")
UrlDownloadToFileA(0,"localhost/file.txt", "C:\file.txt",0,0)
```
May 16, 2021 at 4:37am UTC
salem c
(3700)
Also posted here ->
https://stackoverflow.com/questions/67551618/authgg-c-unresolved-extern-symbols
1. You should be calling URLDownloadToFile
https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms775123(v=vs.85)
Internally, the compiler chooses URLDownloadToFileA or URLDownloadToFileW depending on whether you're compiling for
ANSI
or
UNICODE
(the default for the last decade or two has been UNICODE).
Maybe you used
URLDownloadToFile
and got grief from the parameters not being wide strings, and fixed the wrong problem.
https://devblogs.microsoft.com/oldnewthing/20040212-00/?p=40643
Anyway, try this.
UrlDownloadToFile(0,_T(
"localhost/file.txt"
), _T(
"C:\\file.txt"
),0,0);
Also note the use of \\ on the back slashed local filename.
Last edited on
May 16, 2021 at 4:37am UTC
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs