Reputation: 61
I made custom downloader of IE using IDownloader Interface and URLDownloadToFile method. But URLDownloadToFile return 0x80004004 error code. I wonder! what's wrong in source code?
reference : http://social.msdn.microsoft.com/Forums/en/iewebdevelopment/thread/3fbcea06-4e69-4504-82e0-f4786368a5e2
STDMETHODIMP CDownloader::Download(IMoniker* pmk,
IBindCtx* pbc,
DWORD dwBindVerb,
LONG grfBINDF,
BINDINFO* pBindInfo,
LPCOLESTR pszHeaders,
LPCOLESTR pszRedir,
UINT uiCP )
{
LPOLESTR sDisplayName;
pmk->GetDisplayName(NULL, NULL, &sDisplayName);
HRESULT hr = URLDownloadToFile(NULL, sDisplayName, L"C:\\downloaded.exe", 0, NULL);
return S_OK;
}
Upvotes: 2
Views: 2567
Reputation: 61
I solved it.
COM object on Internet explorer must create file in IE template folder. Because IE protected mode.
Upvotes: 2
Reputation: 49986
This is an error code for E_ABORT, so it looks like your download operation was aborted
From MSDN:
"The download operation can be canceled by returning E_ABORT from any callback"
but since your callback is NULL, it is probably caused by some other problem.
Upvotes: 2