 |
|
 |
A real help, especially the callback stuff.
|
|
|
|
 |
|
 |
Just what I've been looking for, Excellent!
|
|
|
|
 |
|
 |
quite a nice work but it dosen't work on my computer.
the error message is always 0x80004004,i checked the winerror.h and found it
was E_ABORT . i just don't know why. hope your replies,thx
|
|
|
|
 |
|
 |
sorry ,that 's my fault.
"Construct the fully-qualified path for the file to be created."
i did not notice that,i just specified a directory.
now it works well,thx~~~
|
|
|
|
 |
|
 |
I tested this project but this is not working in my system.Can you tell me any exeptions with which this project does'nt work.
|
|
|
|
 |
|
 |
Hi all!
If anyone knows the counterpart syntax of vb6 save method(ex: rs.save filename, adPersistADTG) in VB.Net. Please provide me the exact syntax. I just need an ADO File database(ex: filename.ado).. Many Thanks!!
|
|
|
|
 |
|
 |
Hi Michael,
Does this program have the ability to continue to download if the internet connection has been cut off then it will resume where it stopped when the internet is on again?
thanks,
Jj
|
|
|
|
 |
|
 |
Hi Michael,
Great article btw!
I've adapted your sample and integrated it into my own code. I am currently trying to retrieve the HTTP response code to determine if the file was truly downloaded successfully.
I thought it would be as simple as extending my CBindStatusCallbackImpl class (which currently derives from IBindStatusCallback) to derive from IHttpNegotiate also, and to override the OnResponse method (as the dwResponseCode parameter contains the code). But alas, when I debug the application my breakpoint aint hit
Any ideas/thoughts?
Cheers,
Dave.
|
|
|
|
 |
|
 |
I don't know the answer off the top of my head. URLDownloadToFile() is pretty simple and doesn't give you all the features of using WinInet directly. When I've had to do non-trivial downloading, I've used WinInet.
|
|
|
|
 |
|
|
 |
|
 |
Sweet
|
|
|
|
 |
|
 |
You can get it in CCallback::OnStopBinding()
Here's the code to add to the original sample:
In BindStatusCallback.h
...
CTime m_timeToStop; IBinding* m_pib; int m_nHttpCode;
In BindStatusCallback.cpp
CCallback::CCallback() : m_bUseTimeout(FALSE), m_pDlg(NULL), m_pib(NULL), m_nHttpCode(-1)
Then add the following fcn bodies:
(you'll need to delete their { return E_NOTIMPL; } bodies from BindStatusCallback.h)
HRESULT CCallback::OnStartBinding(DWORD , IBinding* pib)
{
m_pib = pib; m_pib->AddRef();
return S_OK;
}
HRESULT CCallback::OnStopBinding(HRESULT , LPCWSTR )
{
IWinInetHttpInfo* pInfo = NULL;
HRESULT hr = m_pib->QueryInterface(IID_IWinInetHttpInfo, (void**)&pInfo);
if(pInfo && !FAILED(hr))
{
char szHttpCode[32] = {0};
DWORD dwBufSize = sizeof(szHttpCode);
pInfo->QueryInfo(HTTP_QUERY_STATUS_CODE, szHttpCode, &dwBufSize, 0, NULL);
pInfo->Release();
m_nHttpCode = atoi(szHttpCode);
}
m_pib->Release();
return S_OK;
}
Then, finally:
In URLDownloadDlg.cpp
CURLDownloadDlg::WorkerThreadProc()
{
...
hr = URLDownloadToFile ( ... );
TRACE("HTTP code=%d\n", callback.m_nHttpCode);
...
}
I can type "while" and "for" very quickly
|
|
|
|
 |
|
 |
in VC6,need to write like this in URLDownloadDlg.cpp
CURLDownloadDlg::WorkerThreadProc()
{
...
hr = URLDownloadToFile ( ... );
TRACE( _T("HTTP code=%d\n"), callback.m_nHttpCode);
...
}
because the Project used _UNICODE
finally:
thanks for the patch
|
|
|
|
 |
|
 |
error = 800401E4 invalid syntax
ok here's the scope. i had 2 computers. i used exactly the same URL and path. the program only work with one. error = 800401E4 invalid syntax appears only on 1 com of computers. i guess this is because something need to be set with IE. but i duno know what. this error is due to having the URLdownload function in a thread. if its in the main user interface thread it will work. anyone knows how to solve this problem?
|
|
|
|
 |
|
 |
I'm getting the same error on some systems, but not on others, when the downloaded content is JSON. This Google Groups page[^] discusses the same error when downloading gzip content. The thread also discusses why UrlDownloadToFile fails when on the same machine IE will succeed for the same URL (pull mode vs push mode). In the end, it seems that UrlDownloadToFile has some "issues"
I can type "while" and "for" very quickly
|
|
|
|
 |
|
 |
Put the CoInitialize(EX) or OleInitialize where the caller thread start will fix this problem. I have no idea why some machines get this problem and the others dont.
modified on Tuesday, August 5, 2008 1:51 AM
|
|
|
|
 |
|
 |
Eric3580655 wrote: Put the CoInitialize(EX) or OleInitialize where the caller thread start will fix this problem. I have no idea why some machines get this problem and the others dont.
Thank you so much for this information. I have been banging my head against this 800401e4 error for 2 days and googling like crazy. Adding the CoInitializeEx fixed the issue!
|
|
|
|
 |
|
|
 |
|
 |
I don't know really, I'd never looked at URLOpenBlockingStream() (and the other similar functions) before today.
|
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
I have a simple client/server program using Sockets; the transport layer is very simple one request packet going and one packet of information returning from server. As firewalls are evolving they are giving more and more trouble; i wanted to see if i could come with some kind of program running inside the internet explorer which would act as the transport layer; routing information between the client and the server; i have done this with winsocket and mfc...if somebody would have an example code or project that would be really helpful.
Have a great one
Ray
|
|
|
|
 |
|
 |
I am using the program in one schemes with NT4 and with Poxy, when I try to copy the archive is giving to error 0x80070005.
Thanks.
|
|
|
|
 |