I wrote this code to download a web page in VC++:
#include <windows.h>
#include <urlmon.h>
#include <iostream>
#pragma comment(lib, "urlmon.lib")
int main()
{
HRESULT hr;
LPCSTR url = "https://www.example.com";
LPCSTR filename = "example.html";
system("cd");
hr = URLDownloadToFile(NULL, url, filename, 0, NULL);
if (hr == S_OK)
{
std::cout << "File downloaded successfully!" << std::endl;
}
else
{
std::cout << "File download failed." << std::endl;
}
char cmd[80];
sprintf_s(cmd, 80, "type %s", filename);
system(cmd);
return 0;
}
I wanted to see the documentation for the system function, so I put the keyboard cursor on it and pressed F1.
For some reason, it opened a web page with documentation for this:
DTSFileSystemAttributes Enum
Anyone know what I'm doing wrong?
Thank you.